[ 
https://issues.apache.org/jira/browse/MATH-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429687#comment-17429687
 ] 

Alex Herbert commented on MATH-1630:
------------------------------------

The code changes look good. This now empty package can be removed:
{noformat}
commons-math-legacy-core/src/main/java/org/apache/commons/math4/legacy/core/jdkmath/
{noformat}
 
 It would be of use to add {{@see}} tags for each method to link to the 
documentation for java.util.Math as the definition of the method.

What tests do you think are the main issue?

On JDK11 or 17 on MacOS I see these failing (module commons-math-legacy) due to 
differences of a few ULP:

Various in the {{legacy.analysis.differentiation}} package
 * 
{{legacy.analysis.differentiation.DerivativeStructureTest.testCoshDefinition}}
 * 
{{legacy.analysis.differentiation.DerivativeStructureTest.testExpm1Definition}}
 * {{legacy.analysis.differentiation.DerivativeStructureTest.testLog1pExpm1}}
 * {{legacy.analysis.differentiation.DerivativeStructureTest.testSinhAsinh}}
 * 
{{legacy.analysis.differentiation.DerivativeStructureTest.testSinhDefinition}}
 * {{legacy.analysis.differentiation.DerivativeStructureTest.testTanAtan}}
 * {{legacy.analysis.differentiation.DerivativeStructureTest.testTanhAtanh}}

All are related to a comparison to zero.

These fail but are with a relative tolerance of 1e-15.
 * 
{{legacy.fitting.leastsquares.DifferentiatorVectorMultivariateJacobianFunctionTest.testBevington}}
 * 
{{legacy.analysis.differentiation.FiniteDifferencesDifferentiatorTest.testMatrixFunction}}

This test always fails but there is no error message indicating the point of 
failure:
 * {{legacy.ode.JacobianMatricesTest.testHighAccuracyExternalDifferentiation}}

Given the name I assume this to be due to few ULP.

This fails on the second significant digit:
 * 
{{legacy.analysis.differentiation.FiniteDifferencesDifferentiatorTest.testGaussian}}

{noformat}
[ERROR]   Run 1: FiniteDifferencesDifferentiatorTest.testGaussian:121 
expected:<2.477E-13> but was:<2.3851060015900316E-13>
{noformat}
It may be one to investigate.

The build is fine (ignoring the usual flakes for the randomly seeded optimizer 
tests) using the defaults with AccurateMath.

 

> AccurateMath vs JDK's Math
> --------------------------
>
>                 Key: MATH-1630
>                 URL: https://issues.apache.org/jira/browse/MATH-1630
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Gilles Sadowski
>            Assignee: Gilles Sadowski
>            Priority: Minor
>             Fix For: 4.0
>
>
> Allow runtime switch between the JDK and CM implementations of the methods 
> defined in the [{{Math}} 
> class|https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html].
> I [propose|https://markmail.org/message/uw64jproplfa4xqr] to create a 
> {{JdkMath}} class that will store references to either JDK's methods in 
> {{Math}} or CM's methods in {{AccurateMath}}, based on a system property.
> Thus, all CM codes will be updated to call the methods declared in 
> {{JdkMath}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to