function acosh( x ) {
	var t;
	if ( isnan( x ) || x < 1.0 ) {
		return NaN;
	}
	if ( x === 1.0 ) {
		return 0.0;
	}
	if ( x >= HUGE ) {
		return ln( x ) + LN2;
	}
	if ( x > 2.0 ) {
		return ln( (2.0*x) - ( 1.0 / ( x + sqrt( (x*x) - 1.0 ) ) ) );
	}
	// Case: 2 >= x > 1
	t = x - 1.0;
	return log1p( t + sqrt( (2.0*t) + (t*t) ) );
}
Computes the hyperbolic arccosine of a double-precision floating-point number.

## Method

Based on

```tex
\operatorname{acosh}(x) = \log \left[ x + \sqrt{ x^2 - 1 } \right]
```

we have

```tex
\operatorname{acosh}(x) = \begin{cases}
\log(x) + \tfrac{\ln}{2} & \text{ if x is large } \\
\log \left( 2x-\tfrac{1}{\sqrt{x^2-1}+x} \right) & \text{ if } x > 2 \\
\operatorname{log1p}\left( x - 1 + \sqrt{ 2 \cdot (x-1) + (x-1)^2 } \right) & \text{ otherwise }
\end{cases}
```

## Special Cases

```tex
\begin{align*}
\operatorname{acosh}(x) &= \mathrm{NaN}\ \text{ if } x < 1 \\
\end{align*}
```

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

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

@example
var v = acosh( 2.0 );
// returns ~1.317

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