|
amath
1.8.5
Simple command line calculator
|
Hyperbolic cosine function. More...
#include "prim.h"
Go to the source code of this file.
Functions | |
| double | cosh (double x) |
| Hyperbolic cosine function. More... | |
Variables | |
| static const double | one = 1.0 |
| static const double | half = 0.5 |
| static const double | huge = 1.0e300 |
Hyperbolic cosine function.
Definition in file cosh.c.
| double cosh | ( | double | x | ) |
Hyperbolic cosine function.
Mathematically cosh(x) if defined to be (exp(x)+exp(-x))/2
Method
1. Replace x by |x| (cosh(x) = cosh(-x))
2.
[ exp(x) - 1 ]^2
0 <= x <= ln2/2 : cosh(x) := 1 + -------------------
2*exp(x)
exp(x) + 1/exp(x)
ln2/2 <= x <= 22 : cosh(x) := -------------------
2
22 <= x <= lnovft : cosh(x) := exp(x)/2
lnovft <= x <= ln2ovft: cosh(x) := exp(x/2)/2 * exp(x/2)
ln2ovft < x : cosh(x) := huge*huge (overflow)
Special cases:cosh(x) is |x| if x is +INF, -INF, or NaN only cosh(0)=1 is exact for finite x
Definition at line 83 of file cosh.c.
References exp(), expm1(), fabs(), half, huge, and one.
Referenced by cchc(), cchsh(), ccot(), ccoth(), ccsc(), ccsch(), coth(), csec(), csech(), ctan(), ctanh(), RealNumber::HypCosine(), and sech().

