fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git] / toolchain / gcc / newlib / libm / mathfp / s_cosh.c
blob24b542092f2d9686bf5a99ebd3a19c8a88f2a4de
2 /* @(#)z_cosh.c 1.0 98/08/13 */
4 /*
6 FUNCTION
7 <<cosh>>, <<coshf>>---hyperbolic cosine
9 ANSI_SYNOPSIS
10 #include <math.h>
11 double cosh(double <[x]>);
12 float coshf(float <[x]>)
14 TRAD_SYNOPSIS
15 #include <math.h>
16 double cosh(<[x]>)
17 double <[x]>;
19 float coshf(<[x]>)
20 float <[x]>;
22 DESCRIPTION
24 <<cosh>> computes the hyperbolic cosine of the argument <[x]>.
25 <<cosh(<[x]>)>> is defined as
26 @ifnottex
27 . (exp(x) + exp(-x))/2
28 @end ifnottex
29 @tex
30 $${(e^x + e^{-x})} \over 2$$
31 @end tex
33 Angles are specified in radians.
35 <<coshf>> is identical, save that it takes and returns <<float>>.
37 RETURNS
38 The computed value is returned. When the correct value would create
39 an overflow, <<cosh>> returns the value <<HUGE_VAL>> with the
40 appropriate sign, and the global value <<errno>> is set to <<ERANGE>>.
42 You can modify error handling for these functions using the
43 function <<matherr>>.
45 PORTABILITY
46 <<cosh>> is ANSI.
47 <<coshf>> is an extension.
49 QUICKREF
50 cosh ansi pure
51 coshf - pure
54 /******************************************************************
55 * Hyperbolic Cosine
57 * Input:
58 * x - floating point value
60 * Output:
61 * hyperbolic cosine of x
63 * Description:
64 * This routine returns the hyperbolic cosine of x.
66 *****************************************************************/
68 #include "fdlibm.h"
69 #include "zmath.h"
71 #ifndef _DOUBLE_IS_32BITS
73 double
74 _DEFUN (cosh, (double),
75 double x)
77 return (sineh (x, 1));
80 #endif /* _DOUBLE_IS_32BITS */