[
https://issues.apache.org/jira/browse/MATH-1685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035312#comment-18035312
]
Gilles Sadowski commented on MATH-1685:
---------------------------------------
Is the report about a _JDK function_ returning a different digit at the last
decimal place in different computing environments?
It is to be expected; quoting from the
[Javadoc|https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html]
---
[...] a larger error bound of 1 or 2 ulps is allowed for certain methods.
---
The description of the report shows that {{FastMath}} (a class that has indeed
been implemented in the "Commons Math" library) is actually returning the
_same_ value in both environments. This is also expected and one of the goals
of {{FastMath}}.
Please note that {{FastMath}} has been replaced by {{AccurateMath}} (to
emphasize the primary goal) in the current version (4.0-beta1) of ["Commons
Math"|https://commons.apache.org/proper/commons-math/javadocs/api-4.0-beta1/org/apache/commons/math4/core/jdkmath/package-summary.html].
> Math.sin() evaluates to different results on arm64 and x64
> ----------------------------------------------------------
>
> Key: MATH-1685
> URL: https://issues.apache.org/jira/browse/MATH-1685
> Project: Commons Math
> Issue Type: Bug
> Environment: aarch64
> x64
> Reporter: Philipp Rebsamen
> Priority: Minor
>
> When using Math.sin(), certain inputs evaluate to different results on arm64
> and x64 architectures. We have tested it on several Apple M4, M3 and M2
> powered MacBooks as well as some Windows notebooks (all running Windows 11).
> Here are the respective outputs (with comparison to FastMath and StrictMath
> libraries as well):
> x64:
> Math.sin(1.8546554965762145) = 0.9599817810077{*}941{*}
> _FastMath.sin(1.8546554965762145) = 0.9599817810077941_
> _StrictMath.sin(1.8546554965762145) = 0.9599817810077941_
>
> aarch64:
> Math.sin(1.8546554965762145) = 0.9599817810077{*}942{*}
> _FastMath.sin(1.8546554965762145) = 0.9599817810077941_
> _StrictMath.sin(1.8546554965762145) = 0.9599817810077941_
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)