Summary
Add asinh() function to Math.java and StrictMath.java.
Problem
The IEEE 754 2019 standard recommends platform include various "additional mathematical operations" (section 9.2). The asinh (inverse hyperbolic sine) function if one of those.
Solution
Ported the asinh() function from fdlibm.
Specification
In both java.lang.Math and java.lang.StrictMath added:
/**
* Returns the inverse hyperbolic sine of a {@code double} value.
* The inverse hyperbolic sine of <i>x</i> is defined to be a function such that
* asinh({@linkplain Math#sinh sinh(<i>x</i>)}) = <i>x</i> for any <i>x</i>.
* Note that range of the exact asinh is not limited.
* <p>Special cases:
* <ul>
*
* <li>If the argument is zero, then the result is a zero with the
* same sign as the argument.
*
* <li>If the argument is positive infinity, then the result is
* positive infinity.
*
* <li>If the argument is negative infinity, then the result is
* negative infinity.
*
* <li>If the argument is NaN, then the result is NaN.
*
* <p>The computed result must be within 2.5 ulps of the exact result.
*
* </ul>
* @param x The number whose inverse hyperbolic sine is to be returned.
* @return The inverse hyperbolic sine of {@code x}.
* @since 27
*/
public static double asinh(double x) {
return StrictMath.asinh(x);
}
- csr of
-
JDK-8375285 Port fdlibm asinh to Java
-
- Open
-