Go to the documentation of this file.00001
00002 FUNCTION ATANH (X)
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
00030
00031
00032 DIMENSION ATNHCS(15)
00033 LOGICAL FIRST
00034 SAVE ATNHCS, NTERMS, DXREL, SQEPS, FIRST
00035 DATA ATNHCS( 1) / .0943951023 93195492E0 /
00036 DATA ATNHCS( 2) / .0491984370 55786159E0 /
00037 DATA ATNHCS( 3) / .0021025935 22455432E0 /
00038 DATA ATNHCS( 4) / .0001073554 44977611E0 /
00039 DATA ATNHCS( 5) / .0000059782 67249293E0 /
00040 DATA ATNHCS( 6) / .0000003505 06203088E0 /
00041 DATA ATNHCS( 7) / .0000000212 63743437E0 /
00042 DATA ATNHCS( 8) / .0000000013 21694535E0 /
00043 DATA ATNHCS( 9) / .0000000000 83658755E0 /
00044 DATA ATNHCS(10) / .0000000000 05370503E0 /
00045 DATA ATNHCS(11) / .0000000000 00348665E0 /
00046 DATA ATNHCS(12) / .0000000000 00022845E0 /
00047 DATA ATNHCS(13) / .0000000000 00001508E0 /
00048 DATA ATNHCS(14) / .0000000000 00000100E0 /
00049 DATA ATNHCS(15) / .0000000000 00000006E0 /
00050 DATA FIRST /.TRUE./
00051
00052 IF (FIRST) THEN
00053 NTERMS = INITS (ATNHCS, 15, 0.1*R1MACH(3))
00054 DXREL = SQRT (R1MACH(4))
00055 SQEPS = SQRT (3.0*R1MACH(3))
00056 ENDIF
00057 FIRST = .FALSE.
00058
00059 Y = ABS(X)
00060 IF (Y .GE. 1.0) CALL XERMSG ('SLATEC', 'ATANH', 'ABS(X) GE 1', 2,
00061 + 2)
00062
00063 IF (1.0-Y .LT. DXREL) CALL XERMSG ('SLATEC', 'ATANH',
00064 + 'ANSWER LT HALF PRECISION BECAUSE ABS(X) TOO NEAR 1', 1, 1)
00065
00066 ATANH = X
00067 IF (Y.GT.SQEPS .AND. Y.LE.0.5) ATANH = X*(1.0 + CSEVL (8.*X*X-1.,
00068 1 ATNHCS, NTERMS))
00069 IF (Y.GT.0.5) ATANH = 0.5*LOG((1.0+X)/(1.0-X))
00070
00071 RETURN
00072 END