function cosh( x ) {
	if ( isnan( x ) ) {
		return x;
	}
	if ( x < 0.0 ) {
		x = -x;
	}
	if ( x > 21.0 ) {
		return exp( x ) / 2.0;
	}
	return ( exp(x) + exp(-x) ) / 2.0;
}
Computes the hyperbolic cosine of a double-precision floating-point number.

## Method

```tex
\operatorname{cosh}(x) = \frac{ \exp(x) + \exp(-x) }{2}
```

## Notes

-   Relative error:

    | arithmetic | domain   | # trials | peak    | rms     |
    |:----------:|:--------:|:--------:|:-------:|:-------:|
    | DEC        | +- 88    | 50000    | 4.0e-17 | 7.7e-18 |
    | IEEE       | +-MAXLOG | 30000    | 2.6e-16 | 5.7e-17 |

@param {number} x - input value
@returns {number} hyperbolic cosine

@example
var v = cosh( 0.0 );
// returns 1.0

@example
var v = cosh( 2.0 );
// returns ~3.762

@example
var v = cosh( -2.0 );
// returns ~3.762

@example
var v = cosh( NaN );
// returns NaN