RFR: JDK-8302027: Port fdlibm trig functions (sin, cos, tan) to Java [v6]

Joe Darcy darcy at openjdk.org
Sat Mar 4 23:56:29 UTC 2023


> Last and certainly not least in the port of FDLIBM to Java, the transcendental methods for sin, cos, and tan.
> 
> Some more tests are to be written in the StrictMath directory to verify that the StrictMath algorihtm for sin/cos/tan is being used rather than a different one. However, I wanted to get the rest of the change out for review first.
> 
> The sin/cos/tan methods are grouped together since they share the same argument reduction logic. Argument reduction is the process of mapping an argument of a function to an argument in a restricted range (and possibly returning some function of the reduced argument). For sin, cos, and tan, since they are fundamentally periodic with respect to a multiple of pi, argument reduction is done to find the remainder of the original argument with respect to pi/2.

Joe Darcy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits:

 - Merge branch 'master' into JDK-8302027
 - Add test cases with Math and StrictMath differ on a given input.
 - Add more tests.
 - Add note explaining goto translation.
 - Update src/java.base/share/classes/java/lang/FdLibm.java
   
   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
 - Update src/java.base/share/classes/java/lang/FdLibm.java
   
   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
 - Update src/java.base/share/classes/java/lang/FdLibm.java
   
   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
 - Update src/java.base/share/classes/java/lang/FdLibm.java
   
   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
 - Update src/java.base/share/classes/java/lang/FdLibm.java
   
   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
 - Update src/java.base/share/classes/java/lang/FdLibm.java
   
   Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>
 - ... and 10 more: https://git.openjdk.org/jdk/compare/9fdbf3cf...0466a98d

-------------

Changes: https://git.openjdk.org/jdk/pull/12800/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12800&range=05
  Stats: 2305 lines in 7 files changed: 2283 ins; 12 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/12800.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12800/head:pull/12800

PR: https://git.openjdk.org/jdk/pull/12800


More information about the core-libs-dev mailing list