GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
r9lgit.f
Go to the documentation of this file.
1*DECK R9LGIT
2 FUNCTION r9lgit (A, X, ALGAP1)
3C***BEGIN PROLOGUE R9LGIT
4C***SUBSIDIARY
5C***PURPOSE Compute the logarithm of Tricomi's incomplete Gamma
6C function with Perron's continued fraction for large X and
7C A .GE. X.
8C***LIBRARY SLATEC (FNLIB)
9C***CATEGORY C7E
10C***TYPE SINGLE PRECISION (R9LGIT-S, D9LGIT-D)
11C***KEYWORDS FNLIB, INCOMPLETE GAMMA FUNCTION, LOGARITHM,
12C PERRON'S CONTINUED FRACTION, SPECIAL FUNCTIONS, TRICOMI
13C***AUTHOR Fullerton, W., (LANL)
14C***DESCRIPTION
15C
16C Compute the log of Tricomi's incomplete gamma function with Perron's
17C continued fraction for large X and for A .GE. X.
18C
19C***REFERENCES (NONE)
20C***ROUTINES CALLED R1MACH, XERMSG
21C***REVISION HISTORY (YYMMDD)
22C 770701 DATE WRITTEN
23C 890531 Changed all specific intrinsics to generic. (WRB)
24C 890531 REVISION DATE from Version 3.2
25C 891214 Prologue converted to Version 4.0 format. (BAB)
26C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
27C 900720 Routine changed from user-callable to subsidiary. (WRB)
28C***END PROLOGUE R9LGIT
29 SAVE eps, sqeps
30 DATA eps, sqeps / 2*0.0 /
31C***FIRST EXECUTABLE STATEMENT R9LGIT
32 IF (eps.EQ.0.0) eps = 0.5*r1mach(3)
33 IF (sqeps.EQ.0.0) sqeps = sqrt(r1mach(4))
34C
35 IF (x .LE. 0.0 .OR. a .LT. x) CALL xermsg ('SLATEC', 'R9LGIT',
36 + 'X SHOULD BE GT 0.0 AND LE A', 2, 2)
37C
38 ax = a + x
39 a1x = ax + 1.0
40 r = 0.0
41 p = 1.0
42 s = p
43 DO 20 k=1,200
44 fk = k
45 t = (a+fk)*x*(1.0+r)
46 r = t/((ax+fk)*(a1x+fk)-t)
47 p = r*p
48 s = s + p
49 IF (abs(p).LT.eps*s) GO TO 30
50 20 CONTINUE
51 CALL xermsg ('SLATEC', 'R9LGIT',
52 + 'NO CONVERGENCE IN 200 TERMS OF CONTINUED FRACTION', 3, 2)
53C
54 30 hstar = 1.0 - x*s/a1x
55 IF (hstar .LT. sqeps) CALL xermsg ('SLATEC', 'R9LGIT',
56 + 'RESULT LESS THAN HALF PRECISION', 1, 1)
57C
58 r9lgit = -x - algap1 - log(hstar)
59C
60 RETURN
61 END
T eps(const T &x)
Definition data.cc:5008
real function r1mach(i)
Definition r1mach.f:23
function r9lgit(a, x, algap1)
Definition r9lgit.f:3
subroutine xermsg(librar, subrou, messg, nerr, level)
Definition xermsg.f:3