31 SAVE sq2pil, sqpi2l, pi,
xmax, dxrel, first
32 DATA sq2pil / 0.9189385332 0467274e0/
33 DATA sqpi2l / 0.2257913526 4472743e0/
34 DATA pi / 3.1415926535 8979324e0/
44 IF (y.GT.10.0)
GO TO 20
48 alngam =
log(
abs(gamma(x)))
53 20
IF (y .GT.
xmax)
CALL xermsg (
'SLATEC',
'ALNGAM',
54 +
'ABS(X) SO BIG ALNGAM OVERFLOWS', 2, 2)
56 IF (x.GT.0.) alngam = sq2pil + (x-0.5)*
log(x) - x + r9lgmc(y)
59 sinpiy =
abs(sin(pi*y))
60 IF (sinpiy .EQ. 0.)
CALL xermsg (
'SLATEC',
'ALNGAM',
61 +
'X IS A NEGATIVE INTEGER', 3, 2)
63 IF (
abs((x-aint(x-0.5))/x) .LT. dxrel)
CALL xermsg (
'SLATEC',
64 +
'ALNGAM',
'ANSWER LT HALF PRECISION BECAUSE X TOO NEAR ' //
65 +
'NEGATIVE INTEGER', 1, 1)
67 alngam = sqpi2l + (x-0.5)*
log(y) - x -
log(sinpiy) - r9lgmc(y)
octave_int< T > xmax(const octave_int< T > &x, const octave_int< T > &y)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the base of natural logarithms The constant ex $e satisfies the equation log(e)