static public BigDecimal asinh ( final BigDecimal x ) { if ( x . compareTo ( BigDecimal . ZERO ) == 0 ) { return BigDecimal . ZERO ; } else { BigDecimal xhighpr = scalePrec ( x , 2 ) ; /* arcsinh(x) = log(x+hypot(1,x)) */ BigDecimal logx = log ( hypot ( 1 , xhighpr ) . add ( xhighpr ) ) ; /* The absolute error in arcsinh x is err(x)/sqrt(1+x^2) */ double xDbl = x . doubleValue ( ) ; double eps = 0.5 * x . ulp ( ) . doubleValue ( ) / Math . hypot ( 1. , xDbl ) ; MathContext mc = new MathContext ( err2prec ( logx . doubleValue ( ) , eps ) ) ; return logx . round ( mc ) ; } }
The inverse hyperbolic sine .