asinh function

double asinh (double value)

Hyperbolic Area Sine.

Implementation

double asinh(double value) {
  // asinh(x) = Sign(x) * ln(|x| + sqrt(x*x + 1))
  // if |x| > huge, asinh(x) ~= Sign(x) * ln(2|x|)

  if (value.abs() >= 268435456.0) // 2^28, taken from freeBSD
    return value.sign * (stdmath.log(value.abs()) + stdmath.log(2.0));

  return value.sign *
      stdmath.log(value.abs() + stdmath.sqrt((value * value) + 1));
}