JDK-8316690 : Widen allowable error bound of Math.hypot
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 22
  • Submitted: 2023-09-21
  • Updated: 2023-09-30
  • Resolved: 2023-09-21
Related Reports
CSR :  
Description
Summary
-------

Increase the allowable error bounds of `Math.hypot` to 1.5 ulps.

Problem
-------

The FDLIBM `hypot` implementation does not conform to its stated 1 ulp error bound.

Solution
--------

Increase the error bound to cover the worst-case error known so far.

Specification
-------------

    diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java
    index c851630b95a..11c636c8434 100644
    --- a/src/java.base/share/classes/java/lang/Math.java
    +++ b/src/java.base/share/classes/java/lang/Math.java
    @@ -2755,7 +2755,7 @@ public static double tanh(double x) {
          * <li> If both arguments are zero, the result is positive zero.
          * </ul>
          *
    -     * <p>The computed result must be within 1 ulp of the exact
    +     * <p>The computed result must be within 1.5 ulps of the exact
          * result.  If one parameter is held constant, the results must be
          * semi-monotonic in the other parameter.
          *


Comments
Moving to Approved.
21-09-2023