Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316690

Widen allowable error bound of Math.hypot

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 22
    • core-libs
    • None
    • behavioral
    • minimal
    • Change error bound to cover actual implementation.
    • Java API
    • SE

      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.
            *

            darcy Joe Darcy
            darcy Joe Darcy
            Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: