Go to the documentation of this file.00001
00002 DOUBLE PRECISION FUNCTION D9LGIT (A, X, ALGAP1)
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 DOUBLE PRECISION A, X, ALGAP1, AX, A1X, EPS, FK, HSTAR, P, R, S,
00030 1 SQEPS, T, D1MACH
00031 LOGICAL FIRST
00032 SAVE EPS, SQEPS, FIRST
00033 DATA FIRST /.TRUE./
00034
00035 IF (FIRST) THEN
00036 EPS = 0.5D0*D1MACH(3)
00037 SQEPS = SQRT(D1MACH(4))
00038 ENDIF
00039 FIRST = .FALSE.
00040
00041 IF (X .LE. 0.D0 .OR. A .LT. X) CALL XERMSG ('SLATEC', 'D9LGIT',
00042 + 'X SHOULD BE GT 0.0 AND LE A', 2, 2)
00043
00044 AX = A + X
00045 A1X = AX + 1.0D0
00046 R = 0.D0
00047 P = 1.D0
00048 S = P
00049 DO 20 K=1,200
00050 FK = K
00051 T = (A+FK)*X*(1.D0+R)
00052 R = T/((AX+FK)*(A1X+FK)-T)
00053 P = R*P
00054 S = S + P
00055 IF (ABS(P).LT.EPS*S) GO TO 30
00056 20 CONTINUE
00057 CALL XERMSG ('SLATEC', 'D9LGIT',
00058 + 'NO CONVERGENCE IN 200 TERMS OF CONTINUED FRACTION', 3, 2)
00059
00060 30 HSTAR = 1.0D0 - X*S/A1X
00061 IF (HSTAR .LT. SQEPS) CALL XERMSG ('SLATEC', 'D9LGIT',
00062 + 'RESULT LESS THAN HALF PRECISION', 1, 1)
00063
00064 D9LGIT = -X - ALGAP1 - LOG(HSTAR)
00065 RETURN
00066
00067 END