News for hackers. Stuff that matters.
Re:Faster asin() was hiding in plain sight by adampunk on Wednesday March 11, 2026 @11:07AM (#47336622)
We love to leave faster functions languishing in library code. The basis for Q3A’s fast inverse square root had been sitting in fdlibm since 1986, on the net since 1993: https://www.netlib.org/fdlibm/e_sqrt.c
Re:Faster asin() was hiding in plain sight by def-pri-pub on Wednesday March 11, 2026 @02:11PM (#47339101)
Funny enough that fdlimb implementation of asin() did come up in my research. I believe it might have been more performant in the past. But taking a quick scan of `e_asin.c`, I see it doing something similar to the Cg asin() implementation (but with more terms and more multiplications, which my guess is that it's slower). I think I see it also taking more branches (which could also lead to more of a slowdown).
Re:Faster asin() was hiding in plain sight by adampunk on Wednesday March 11, 2026 @04:14PM (#47340817)
Yeah Ng’s work in fdlibm is cool and really clever in parts but a lot of branching. Some of the ways they reach correct rounding are…so cool.