Re:Faster asin() was hiding in plain sight
by def-pri-pub on Wednesday March 11, 2026 @02:30PM
(#47339337)
The reason for writing out all of the x multiplications like that is that I was hoping the compiler detect such a pattern perform an optimization for me. Mat Godbolt's "Advent of Compiler Optimizations" series mentions some of these cases where the compiler can do more auto-optimizations for the developer.
[ Parent
| on HN ]
Re:Faster asin() was hiding in plain sight
by pavpanchekha on Wednesday March 11, 2026 @02:54PM
(#47339653)
Horner's form is typically also more accurate, or at least, it is not bit-identical, so the compiler won't do it unless you pass -funsafe-math, and maybe not even then.