fun acosh(value: Double): Double { if (value <= 1.0) { return if (ANTI_JIT_OPTIM_CRASH_ON_NAN) { if (value < 1.0) Double.NaN else value - 1.0 } else { if (value == 1.0) 0.0 else Double.NaN } } val result: Double if (value < ASINH_ACOSH_SQRT_ELISION_THRESHOLD) { result = log(value + sqrt(value * value - 1.0)) } else { result = LOG_2 + log(value) } return result }
Some properties of acosh ( x ) = log ( x + sqrt ( x^2 - 1 ) ) : 1 ) defined on [ 1 , +Infinity [ 2 ) result in ] 0 , +Infinity [ ( by convention , since cosh ( x ) = cosh ( -x ) ) 3 ) acosh ( 1 ) = 0 4 ) acosh ( 1+epsilon ) ~= log ( 1 + sqrt ( 2*epsilon ) ) ~= sqrt ( 2*epsilon ) 5 ) lim ( acosh ( x ) , x- > +Infinity ) = +Infinity ( y increasing logarithmically slower than x )