News for hackers. Stuff that matters.
Re:Faster asin() was hiding in plain sight by woadwarrior01 on Wednesday March 11, 2026 @01:50PM (#47338816)
The common subexpression elimination (CSE) pass in compilers takes care of that.
Re:Faster asin() was hiding in plain sight by cmovq on Wednesday March 11, 2026 @02:04PM (#47339008)
Compilers cannot do this optimization for floating point [1] unless you're compiling with -ffast-math. In general, don't rely on compilers to optimize floating point sub-expressions.

[1]: https://godbolt.org/z/8bEjE9Wxx

Re:Faster asin() was hiding in plain sight by woadwarrior01 on Wednesday March 11, 2026 @02:26PM (#47339293)
Right, I totally forgot about floating point non associativity.