14 REAL AEPS, AINTA, ALGAP1, ALNEPS, ALNG, ALX,
15 $ bot, h, sga, sgngam, sqeps, t, r1mach,
r9gmit,
20 SAVE alneps, sqeps, bot, first
24 if (x .eq. 0.0e0)
then
26 if (a .eq. 0.0e0)
then
35 alneps = -
log(r1mach(3))
36 sqeps =
sqrt(r1mach(4))
41 IF (x .LT. 0.e0) CALL
xermsg(
'SLATEC',
'XGMAINC',
'X IS NEGATIVE'
44 IF (x.NE.0.e0) alx =
log(x)
46 IF (a.NE.0.e0) sga = sign(1.0e0, a)
47 ainta = aint(a + 0.5e0*sga)
55 20
IF (x.GT.1.e0) go
to 30
56 IF (a.GE.(-0.5e0) .OR. aeps.NE.0.e0) CALL
algams(a+1.0e0, algap1,
59 result =
exp(a*alx +
log(
r9gmit(a, x, algap1, sgngam, alx)))
62 30
IF (a.LT.x) go
to 40
66 result =
exp(a*alx + t)
69 40 alng =
r9lgic(a, x, alx)
74 IF (aeps.EQ.0.e0 .AND. ainta.LE.0.e0) go
to 50
76 CALL
algams(a+1.0e0, algap1, sgngam)
77 t =
log(
abs(a)) + alng - algap1
78 IF (t.GT.alneps) go
to 60
80 IF (t.GT.(-alneps)) h = 1.0e0 - sga * sgngam *
exp(t)
81 IF (
abs(h).GT.sqeps) go
to 50
84 CALL
xermsg(
'SLATEC',
'XGMAINC',
'RESULT LT HALF PRECISION', 1,
94 60
IF (t.LT.bot) CALL
xerclr
95 result = -sga * sgngam *
exp(t)
function r9lgit(A, X, ALGAP1)
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)
function r9gmit(A, X, ALGAP1, SGNGAM, ALX)
subroutine algams(X, ALGAM, SGNGAM)
may be zero for pure relative error test tem the relative tolerance must be greater than or equal to
subroutine xermsg(LIBRAR, SUBROU, MESSG, NERR, LEVEL)
function r9lgic(A, X, ALX)
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
subroutine xsgammainc(a, x, result)
octave_value sqrt(void) const