Go to the documentation of this file.00001
00002 FUNCTION R9LGIT (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 SAVE EPS, SQEPS
00030 DATA EPS, SQEPS / 2*0.0 /
00031
00032 IF (EPS.EQ.0.0) EPS = 0.5*R1MACH(3)
00033 IF (SQEPS.EQ.0.0) SQEPS = SQRT(R1MACH(4))
00034
00035 IF (X .LE. 0.0 .OR. A .LT. X) CALL XERMSG ('SLATEC', 'R9LGIT',
00036 + 'X SHOULD BE GT 0.0 AND LE A', 2, 2)
00037
00038 AX = A + X
00039 A1X = AX + 1.0
00040 R = 0.0
00041 P = 1.0
00042 S = P
00043 DO 20 K=1,200
00044 FK = K
00045 T = (A+FK)*X*(1.0+R)
00046 R = T/((AX+FK)*(A1X+FK)-T)
00047 P = R*P
00048 S = S + P
00049 IF (ABS(P).LT.EPS*S) GO TO 30
00050 20 CONTINUE
00051 CALL XERMSG ('SLATEC', 'R9LGIT',
00052 + 'NO CONVERGENCE IN 200 TERMS OF CONTINUED FRACTION', 3, 2)
00053
00054 30 HSTAR = 1.0 - X*S/A1X
00055 IF (HSTAR .LT. SQEPS) CALL XERMSG ('SLATEC', 'R9LGIT',
00056 + 'RESULT LESS THAN HALF PRECISION', 1, 1)
00057
00058 R9LGIT = -X - ALGAP1 - LOG(HSTAR)
00059
00060 RETURN
00061 END