Re:High Performance Correctly Rounded Math Libraries for 32-...
by titzer on Thursday August 26, 2021 @04:52PM
(#28320557)
> I think Julia takes an interesting approach here of never reordering floating point computations
WebAssembly as well. IEEE-754 is mandated and there are no unsafe compiler optimizations allowed. This is the only sane choice. It's just too hard to reason about programs otherwise. Nothing about a super-intelligent machine completely reorganizing your code in a way that subtly breaks it is good, IMHO.
Re:High Performance Correctly Rounded Math Libraries for 32-...
by thxg on Thursday August 26, 2021 @04:35PM
(#28320330)
> FMA is a godsend for writing accurate arithmatic.
True, and the small performance boost (on some platforms) is nice too
> never reordering floating point computations unless you explecitly give permission
Yes, requiring explicit code for FMA and arithmetic grouping/reordering in general seems like the sane approach.
I think Julia takes an interesting approach here of never reordering floating point computations unless you explecitly give permission using @fastmath (which acts locally instead of globally like a --fast-math in C/C++). This makes it much easier to use ieee specific tricks and be confident that the compiler won't mess with you, while still making it easy to tell the compiler to do what it wants.