You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
As part of investigating a unrelated issue I found an input for fmaf where libm returns a different result from the native fmadd instruction on aarch64. Note, the issue is arch independent, I'm using aarch64 to compare because it has a native fmadd instruction.
The result is only off by 1 ULP, does libm target this level of precision?
Here's the example program:
fn main() {
let a = f32::from_bits(1266679807);
let b = f32::from_bits(1300234242);
let c = f32::from_bits(1115553792);
let expected = f32::from_bits(1501560833);
let native_mul_add = a.mul_add(b, c);
let native_bits = native_mul_add.to_bits();
let libm = libm::fmaf(a, b, c);
let libm_bits = libm.to_bits();
println!("expected: {}", expected.to_bits());
println!("native : {}", native_bits);
println!("libm : {}", libm_bits);
}