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
dasinh.f
Go to the documentation of this file.
1 *DECK DASINH
2  DOUBLE PRECISION FUNCTION dasinh (X)
3 C***BEGIN PROLOGUE DASINH
4 C***PURPOSE Compute the arc hyperbolic sine.
5 C***LIBRARY SLATEC (FNLIB)
6 C***CATEGORY C4C
7 C***TYPE DOUBLE PRECISION (ASINH-S, DASINH-D, CASINH-C)
8 C***KEYWORDS ARC HYPERBOLIC SINE, ASINH, ELEMENTARY FUNCTIONS, FNLIB,
9 C INVERSE HYPERBOLIC SINE
10 C***AUTHOR Fullerton, W., (LANL)
11 C***DESCRIPTION
12 C
13 C DASINH(X) calculates the double precision arc hyperbolic
14 C sine for double precision argument X.
15 C
16 C***REFERENCES (NONE)
17 C***ROUTINES CALLED D1MACH, DCSEVL, INITDS
18 C***REVISION HISTORY (YYMMDD)
19 C 770601 DATE WRITTEN
20 C 890531 Changed all specific intrinsics to generic. (WRB)
21 C 890531 REVISION DATE from Version 3.2
22 C 891214 Prologue converted to Version 4.0 format. (BAB)
23 C***END PROLOGUE DASINH
24  DOUBLE PRECISION x, asnhcs(39), aln2, sqeps, xmax, y,
25  1 dcsevl, d1mach
26  LOGICAL first
27  SAVE asnhcs, aln2, nterms, xmax, sqeps, first
28  DATA asnhcs( 1) / -.1282003991 1738186343 3721273592 68 d+0 /
29  DATA asnhcs( 2) / -.5881176118 9951767565 2117571383 62 d-1 /
30  DATA asnhcs( 3) / +.4727465432 2124815640 7252497560 29 d-2 /
31  DATA asnhcs( 4) / -.4938363162 6536172101 3601747902 73 d-3 /
32  DATA asnhcs( 5) / +.5850620705 8557412287 4948352593 21 d-4 /
33  DATA asnhcs( 6) / -.7466998328 9313681354 7550692171 88 d-5 /
34  DATA asnhcs( 7) / +.1001169358 3558199265 9661920158 12 d-5 /
35  DATA asnhcs( 8) / -.1390354385 8708333608 6164722588 86 d-6 /
36  DATA asnhcs( 9) / +.1982316948 3172793547 3173602371 48 d-7 /
37  DATA asnhcs( 10) / -.2884746841 7848843612 7472728003 17 d-8 /
38  DATA asnhcs( 11) / +.4267296546 7159937953 4575149959 07 d-9 /
39  DATA asnhcs( 12) / -.6397608465 4366357868 7526323096 81 d-10 /
40  DATA asnhcs( 13) / +.9699168608 9064704147 8782931311 79 d-11 /
41  DATA asnhcs( 14) / -.1484427697 2043770830 2466583656 96 d-11 /
42  DATA asnhcs( 15) / +.2290373793 9027447988 0401843789 83 d-12 /
43  DATA asnhcs( 16) / -.3558839513 2732645159 9789426513 10 d-13 /
44  DATA asnhcs( 17) / +.5563969408 0056789953 3745390885 54 d-14 /
45  DATA asnhcs( 18) / -.8746250959 9624678045 6665935201 62 d-15 /
46  DATA asnhcs( 19) / +.1381524884 4526692155 8688022981 29 d-15 /
47  DATA asnhcs( 20) / -.2191668828 2900363984 9551422641 49 d-16 /
48  DATA asnhcs( 21) / +.3490465852 4827565638 3139237068 80 d-17 /
49  DATA asnhcs( 22) / -.5578578840 0895742439 6301570321 06 d-18 /
50  DATA asnhcs( 23) / +.8944514661 7134012551 0508827989 33 d-19 /
51  DATA asnhcs( 24) / -.1438342634 6571317305 5518452394 66 d-19 /
52  DATA asnhcs( 25) / +.2319181187 2169963036 3261446826 66 d-20 /
53  DATA asnhcs( 26) / -.3748700795 3314343674 5706045439 99 d-21 /
54  DATA asnhcs( 27) / +.6073210982 2064279404 5492428800 00 d-22 /
55  DATA asnhcs( 28) / -.9859940276 4633583177 3701734400 00 d-23 /
56  DATA asnhcs( 29) / +.1603921745 2788496315 2326382933 33 d-23 /
57  DATA asnhcs( 30) / -.2613884735 0287686596 7161343999 99 d-24 /
58  DATA asnhcs( 31) / +.4267084960 6857390833 3581653333 33 d-25 /
59  DATA asnhcs( 32) / -.6977021703 9185243299 7307733333 33 d-26 /
60  DATA asnhcs( 33) / +.1142508833 6806858659 8126933333 33 d-26 /
61  DATA asnhcs( 34) / -.1873529207 8860968933 0210133333 33 d-27 /
62  DATA asnhcs( 35) / +.3076358441 4464922794 0659200000 00 d-28 /
63  DATA asnhcs( 36) / -.5057736403 1639824787 0463999999 99 d-29 /
64  DATA asnhcs( 37) / +.8325075471 2689142224 2133333333 33 d-30 /
65  DATA asnhcs( 38) / -.1371845728 2501044163 9253333333 33 d-30 /
66  DATA asnhcs( 39) / +.2262986842 6552784104 1066666666 66 d-31 /
67  DATA aln2 / 0.6931471805 5994530941 7232121458 18d0 /
68  DATA first /.true./
69 C***FIRST EXECUTABLE STATEMENT DASINH
70  IF (first) THEN
71  nterms = initds(asnhcs, 39, 0.1*REAL(D1MACH(3)) )
72  sqeps = sqrt(d1mach(3))
73  xmax = 1.0d0/sqeps
74  ENDIF
75  first = .false.
76 C
77  y = abs(x)
78  IF (y.GT.1.0d0) go to 20
79 C
80  dasinh = x
81  IF (y.GT.sqeps) dasinh = x*(1.0d0 + dcsevl(2.d0*x*x-1.d0,
82  1 asnhcs, nterms) )
83  RETURN
84  20 IF (y.LT.xmax) dasinh = log(y+sqrt(y*y+1.d0))
85  IF (y.GE.xmax) dasinh = aln2 + log(y)
86  dasinh = sign(dasinh, x)
87  RETURN
88 C
89  END