00001 *DECK DACOSH 00002 DOUBLE PRECISION FUNCTION DACOSH (X) 00003 C***BEGIN PROLOGUE DACOSH 00004 C***PURPOSE Compute the arc hyperbolic cosine. 00005 C***LIBRARY SLATEC (FNLIB) 00006 C***CATEGORY C4C 00007 C***TYPE DOUBLE PRECISION (ACOSH-S, DACOSH-D, CACOSH-C) 00008 C***KEYWORDS ACOSH, ARC HYPERBOLIC COSINE, ELEMENTARY FUNCTIONS, FNLIB, 00009 C INVERSE HYPERBOLIC COSINE 00010 C***AUTHOR Fullerton, W., (LANL) 00011 C***DESCRIPTION 00012 C 00013 C DACOSH(X) calculates the double precision arc hyperbolic cosine for 00014 C double precision argument X. The result is returned on the 00015 C positive branch. 00016 C 00017 C***REFERENCES (NONE) 00018 C***ROUTINES CALLED D1MACH, XERMSG 00019 C***REVISION HISTORY (YYMMDD) 00020 C 770601 DATE WRITTEN 00021 C 890531 Changed all specific intrinsics to generic. (WRB) 00022 C 890531 REVISION DATE from Version 3.2 00023 C 891214 Prologue converted to Version 4.0 format. (BAB) 00024 C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ) 00025 C***END PROLOGUE DACOSH 00026 DOUBLE PRECISION X, DLN2, XMAX, D1MACH 00027 SAVE DLN2, XMAX 00028 DATA DLN2 / 0.6931471805 5994530941 7232121458 18 D0 / 00029 DATA XMAX / 0.D0 / 00030 C***FIRST EXECUTABLE STATEMENT DACOSH 00031 IF (XMAX.EQ.0.D0) XMAX = 1.0D0/SQRT(D1MACH(3)) 00032 C 00033 IF (X .LT. 1.D0) CALL XERMSG ('SLATEC', 'DACOSH', 00034 + 'X LESS THAN 1', 1, 2) 00035 C 00036 IF (X.LT.XMAX) DACOSH = LOG (X+SQRT(X*X-1.0D0)) 00037 IF (X.GE.XMAX) DACOSH = DLN2 + LOG(X) 00038 C 00039 RETURN 00040 END