News for hackers. Stuff that matters.
Re:FastDoubleParser: Java port of Daniel Lemires fast_double... by ygra on Monday March 22, 2021 @04:28PM (#26546479)
I guess Swift just adopted a similar thing to -ffast-math which some C compilers offer where guarantees about precision of floating-point operations are thrown away to get a similar result faster. Incidentally, that could deserve a better name as well (oh, there seems to be a -funsafe-math-optimizations, which reads a lot closer to what is intended).
Re:FastDoubleParser: Java port of Daniel Lemires fast_double... by cozzyd on Monday March 22, 2021 @10:47PM (#26550431)
Who wouldn't want some fun, safe, math optimizations!

I still don't think it's very descriptive though. Whether or not it's unsafe depends a lot on the domain. In most of my code, I don't care about the sign of zero or floating point associativity and want my compiler to auto convert division to multiplication by reciprocals. Better would be something like -fnon-compliant-float-math or something.

Although I guess -fno-trapping-math is a bit different from the other optimizations which could actually be "unsafe" in a different way, since signaling nans are quite useful for debugging.

Re:FastDoubleParser: Java port of Daniel Lemires fast_double... by j16sdiz on Tuesday March 23, 2021 @01:03AM (#26551316)
In java, method need 'strictfp' modifier to get correct math.
Re:FastDoubleParser: Java port of Daniel Lemires fast_double... by thu2111 on Tuesday March 23, 2021 @06:43AM (#26553384)
That's not been the case for a very long time and even then it wasn't really about 'correctness'. Actually there's a proposal to delete strictfp from the language:

http://openjdk.java.net/jeps/306