2 /* @(#)z_sinehf.c 1.0 98/08/13 */
3 /******************************************************************
4 * The following routines are coded directly from the algorithms
5 * and coefficients given in "Software Manual for the Elementary
6 * Functions" by William J. Cody, Jr. and William Waite, Prentice
8 ******************************************************************/
9 /******************************************************************
13 * x - floating point value
16 * hyperbolic sine of x
19 * This routine calculates hyperbolic sines.
21 *****************************************************************/
27 static const float q
[] = { -0.428277109e+2 };
28 static const float p
[] = { -0.713793159e+1,
30 static const float LNV
= 0.6931610107;
31 static const float INV_V2
= 0.2499930850;
32 static const float V_OVER2_MINUS1
= 0.1383027787e-4;
38 float y
, f
, P
, Q
, R
, res
, z
, w
;
42 /* Check for special values. */
50 return (ispos (x
) ? z_infinity_f
.f
: -z_infinity_f
.f
);
55 if (!cosineh
&& x
< 0.0)
58 if ((y
> 1.0 && !cosineh
) || cosineh
)
64 /* Check for w > maximum here. */
74 res
= z
* (V_OVER2_MINUS1
+ 1.0);
81 res
= (z
+ 1 / z
) / 2.0;
83 res
= (z
- 1 / z
) / 2.0;
91 /* Check for y being too small. */
96 /* Calculate the Taylor series. */