1 /* ******************************************************
 2    *                                                    *
 3    *                                                    *
 4    * Copyright (c) 1972 by Massachusetts Institute of   *
 5    * Technology and Honeywell Information Systems, Inc. *
 6    *                                                    *
 7    *                                                    *
 8    ****************************************************** */
 9 
10 /* modified by A. Downing 07/16/73 to use round builtin function */
11 
12 sinh_: procedure (number) returns (float binary (27));
13 
14 /*     compute the hyperbolic sine or cosine of a single-precision floating-point number     */
15 declare (number, n, p, r) float binary (27),
16         (a, b) float binary (63);
17 dcl  code_ ext entry (fixed bin),
18      (abs, exp, round) builtin;
19           n = number;
20           r = abs (n);
21 if r >= 0.67943378e0 then large: do;
22                p = -1.e0;
23                go to sinhs;
24           end large;
25           if r < 5.e-5 then go to negate;
26           a = r;
27           b = a*a;
28           a = ((((0.2755731922398589065e-5 * b + 0.1984126984126984127e-3) * b + 0.8333333333333333333e-2) * b
29           + 0.1666666666666666667e0) * b + 1.e0) * a;
30           go to finis;
31 cosh_: entry (number) returns (float binary (27));
32           n, r = abs (number);
33           p = 1.e0;
34 sinhs: if r > 88.028e0 then err: do;
35                call code_ (39);
36                r = 170141182.e30;
37                go to negate;
38           end err;
39           a = exp (r);
40           a = (p/a + a) * 0.5e0;
41 finis:    r = round (a, 28);
42 negate:   if n < 0.0e0 then r = -r;
43           return (r);
44      end sinh_;