[Bug c++/122304] UB MArch x86_64 v3/4 rounding Errors

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Oct 17 15:39:57 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122304

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
One more thing contraction is about the use of `fused multiply add` set of
instructions which does the multipy and add in infinite precision before doing
the rounding to the specific precision. This can cause unexpected rounding
errors especially when code is not expecting this added precision.

and if you look at the expected values and the resulting values they are off by
a small amount:
0.896949828 and: 0.896951199
but higher than the code's threshold of 1e-7.


More information about the Gcc-bugs mailing list