JDK-8326537 : Widen allowable error bound of Math.tan
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 23
  • Submitted: 2024-02-22
  • Updated: 2024-02-23
  • Resolved: 2024-02-23
Related Reports
CSR :  
Description
Summary
-------

Widen allowable error bound of Math.tan to accommodate a demonstrated worst-case error bound slightly outside of the currently allowable range.

Problem
-------

Recent work  (https://members.loria.fr/PZimmermann/papers/accuracy.pdf) has found a worst-case error bound for an FDLIBM-derived math library that is slightly outside of the analytically understood worst-case.

Solution
--------

Widen the stated error bound from less than 1 ulp to less than 1.25 ulps, which would allow the 1.02 ulps worst-case observed bound.

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

    diff --git a/src/java.base/share/classes/java/lang/Math.java b/src/java.base/share/classes/java/lang/Math.java
    index 11c636c8434..fa45b6436c7 100644
    --- a/src/java.base/share/classes/java/lang/Math.java
    +++ b/src/java.base/share/classes/java/lang/Math.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1994, 2023, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -212,7 +212,7 @@ public static double cos(double a) {
          * <li>If the argument is zero, then the result is a zero with the
          * same sign as the argument.</ul>
          *
    -     * <p>The computed result must be within 1 ulp of the exact result.
    +     * <p>The computed result must be within 1.25 ulps of the exact result.
          * Results must be semi-monotonic.
          *
          * @param   a   an angle, in radians.


Comments
Moving to Approved.
23-02-2024