-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect fmaf
results on some inputs
#263
Comments
fmaf
results on AArch64fmaf
results on some inputs
The implementation in this crate is based on the one in musl libc. Could you try comparing it against that? Also what does this operation return on different platforms? In theory FMA is specified by IEEE and should return the same return on all platforms. |
Sure, I ran the example code in a docker container with results:
I also converted this over to C to test in an alpine container, which as far as I know will link with musl (not sure if I've done something wrong here). code:
results:
As far as I understand x86 does not have a native scalar fma instruction so it gets lowered to a lib call, both x86_64-pc-windows-msvc:
x86_64-unknown-linux-gnu:
We can also test the native simd version of x86 if we use test code:
result:
The other arch that we had on our testsuite was |
Ported from upstream musl commit 4f3d346bffdf9ed2b1803653643dc31242490944 Fixes #263
Hey,
As part of investigating a unrelated issue I found an input for
fmaf
where libm returns a different result from the nativefmadd
instruction onaarch64
. Note, the issue is arch independent, I'm using aarch64 to compare because it has a nativefmadd
instruction.The result is only off by 1 ULP, does libm target this level of precision?
Here's the example program:
Outputs:
I don't think this is related to #200, I don't get a panic.
Another input that also fails is:
The text was updated successfully, but these errors were encountered: