Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / mathfp / s_cosh.c
blob9d6f8d1cee2fecdd4fd1230fab6c37360379c8a5
2 /* @(#)z_cosh.c 1.0 98/08/13 */
4 /*
6 FUNCTION
7 <<cosh>>, <<coshf>>---hyperbolic cosine
9 SYNOPSIS
10 #include <math.h>
11 double cosh(double <[x]>);
12 float coshf(float <[x]>);
14 DESCRIPTION
16 <<cosh>> computes the hyperbolic cosine of the argument <[x]>.
17 <<cosh(<[x]>)>> is defined as
18 @ifnottex
19 . (exp(x) + exp(-x))/2
20 @end ifnottex
21 @tex
22 $${(e^x + e^{-x})} \over 2$$
23 @end tex
25 Angles are specified in radians.
27 <<coshf>> is identical, save that it takes and returns <<float>>.
29 RETURNS
30 The computed value is returned. When the correct value would create
31 an overflow, <<cosh>> returns the value <<HUGE_VAL>> with the
32 appropriate sign, and the global value <<errno>> is set to <<ERANGE>>.
34 PORTABILITY
35 <<cosh>> is ANSI.
36 <<coshf>> is an extension.
38 QUICKREF
39 cosh ansi pure
40 coshf - pure
43 /******************************************************************
44 * Hyperbolic Cosine
46 * Input:
47 * x - floating point value
49 * Output:
50 * hyperbolic cosine of x
52 * Description:
53 * This routine returns the hyperbolic cosine of x.
55 *****************************************************************/
57 #include "fdlibm.h"
58 #include "zmath.h"
60 #ifndef _DOUBLE_IS_32BITS
62 double
63 cosh (double x)
65 return (sineh (x, 1));
68 #endif /* _DOUBLE_IS_32BITS */