GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
d9lgic.f
Go to the documentation of this file.
1*DECK D9LGIC
2 DOUBLE PRECISION FUNCTION d9lgic (A, X, ALX)
3C***BEGIN PROLOGUE D9LGIC
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 DOUBLE 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 D1MACH, 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 D9LGIC
28 DOUBLE PRECISION a, x, alx, eps, fk, p, r, s, t, xma, xpa, d1mach
29 SAVE eps
30 DATA eps / 0.d0 /
31C***FIRST EXECUTABLE STATEMENT D9LGIC
32 IF (eps.EQ.0.d0) eps = 0.5d0*d1mach(3)
33C
34 xpa = x + 1.0d0 - a
35 xma = x - 1.d0 - a
36C
37 r = 0.d0
38 p = 1.d0
39 s = p
40 DO 10 k=1,300
41 fk = k
42 t = fk*(a-fk)*(1.d0+r)
43 r = -t/((xma+2.d0*fk)*(xpa+2.d0*fk)+t)
44 p = r*p
45 s = s + p
46 IF (abs(p).LT.eps*s) GO TO 20
47 10 CONTINUE
48 CALL xermsg ('SLATEC', 'D9LGIC',
49 + 'NO CONVERGENCE IN 300 TERMS OF CONTINUED FRACTION', 1, 2)
50C
51 20 d9lgic = a*alx - x + log(s/xpa)
52C
53 RETURN
54 END
double precision function d1mach(i)
Definition d1mach.f:23
double precision function d9lgic(a, x, alx)
Definition d9lgic.f:3
T eps(const T &x)
Definition data.cc:5008
subroutine xermsg(librar, subrou, messg, nerr, level)
Definition xermsg.f:3