News for hackers. Stuff that matters.
Re:Beware of Fast-Math by stingraycharles on Saturday May 31, 2025 @08:35AM (#44143852)
Yup, because of the imprecision of floating points, cannot just assume that “(a + c) + (b + d)” is the same as “a + b + c + d”.

It would be pretty ironic if at some point fixed point / bignum implementations end up being faster because of this.

Re:Beware of Fast-Math by anthk on Saturday May 31, 2025 @10:26AM (#44144484)
They are, just check anything fixed-point for the 486SX vs anything floating under a 486DX. It's faster scaling and sum and print the desired precision than operating on floats.
Re:Beware of Fast-Math by stingraycharles on Tuesday June 03, 2025 @11:37AM (#44171197)
Is that also the case for modern architectures? Eg is there SIMD fixed precision?
Re:Beware of Fast-Math by einpoklum on Saturday May 31, 2025 @05:31PM (#44147049)
I wonder... couldn't there just be some library type for this, e.g. `associative::float` and `associative::doube` and such (in C++ terms), so that compilers can ignore non-associativity for actions on values of these types? Or attributes one can place on variables to force assumption of associativity?