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