GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
acosh.f
Go to the documentation of this file.
1 *DECK ACOSH
2  FUNCTION acosh (X)
3 C***BEGIN PROLOGUE ACOSH
4 C***PURPOSE Compute the arc hyperbolic cosine.
5 C***LIBRARY SLATEC (FNLIB)
6 C***CATEGORY C4C
7 C***TYPE SINGLE PRECISION (ACOSH-S, DACOSH-D, CACOSH-C)
8 C***KEYWORDS ACOSH, ARC HYPERBOLIC COSINE, ELEMENTARY FUNCTIONS, FNLIB,
9 C INVERSE HYPERBOLIC COSINE
10 C***AUTHOR Fullerton, W., (LANL)
11 C***DESCRIPTION
12 C
13 C ACOSH(X) computes the arc hyperbolic cosine of X.
14 C
15 C***REFERENCES (NONE)
16 C***ROUTINES CALLED R1MACH, XERMSG
17 C***REVISION HISTORY (YYMMDD)
18 C 770401 DATE WRITTEN
19 C 890531 Changed all specific intrinsics to generic. (WRB)
20 C 890531 REVISION DATE from Version 3.2
21 C 891214 Prologue converted to Version 4.0 format. (BAB)
22 C 900315 CALLs to XERROR changed to CALLs to XERMSG. (THJ)
23 C 900326 Removed duplicate information from DESCRIPTION section.
24 C (WRB)
25 C***END PROLOGUE ACOSH
26  SAVE aln2,xmax
27  DATA aln2 / 0.6931471805 5994530942e0/
28  DATA xmax /0./
29 C***FIRST EXECUTABLE STATEMENT ACOSH
30  IF (xmax.EQ.0.) xmax = 1.0/sqrt(r1mach(3))
31 C
32  IF (x .LT. 1.0) CALL xermsg('SLATEC', 'ACOSH', 'X LESS THAN 1',
33  + 1, 2)
34 C
35  IF (x.LT.xmax) acosh = log(x + sqrt(x*x-1.0))
36  IF (x.GE.xmax) acosh = aln2 + log(x)
37 C
38  RETURN
39  END