1 /* ******************************************************
 2    *                                                    *
 3    *                                                    *
 4    * Copyright (c) 1972 by Massachusetts Institute of   *
 5    * Technology and Honeywell Information Systems, Inc. *
 6    *                                                    *
 7    *                                                    *
 8    ****************************************************** */
 9 
10 dasinh_: procedure (number) returns (float binary (63));
11 
12 /*       compute the hyperbolic arcsine or arccosine of a double-precision floating-point number       */
13 declare (number, f, n, p, q, r) float binary (63),
14           (abs, log, sqrt) builtin;
15 dcl  code_ ext entry (fixed bin);
16           n = number;
17           f = abs (n);
18           if f < 1.e-10 then go to negate;
19           if f >= 3037000500.e0 then go to setup;
20           p = f*f;
21           q = sqrt (p + 1.e0);
22           r = q - 1.e0;
23           p = (r*r + p) * 0.5e0 / q;
24 loner:    f = log (f + p + 1);
25 negate:   if n < 0.0e0 then f = -f;
26           return (f);
27 dacosh_: entry (number) returns (float binary (63));
28           f, n = abs (number);
29 if f < 1.e0 then err: do;
30                call code_ (35);
31                return (0.0e0);
32           end err;
33 setup:    p = f - 1.e0;
34           if f < 3037000500.e0 then f = sqrt ((f + 1.e0) * p);
35           go to loner;
36      end dasinh_;