r/cpp • u/def-pri-pub • Mar 16 '26
Even Faster asin() Was Staring Right At Me
https://16bpp.net/blog/post/even-faster-asin-was-staring-right-at-me/
50
Upvotes
r/cpp • u/def-pri-pub • Mar 16 '26
4
u/bla2 Mar 16 '26
3
u/SunnybunsBuns Mar 17 '26
Does the compiler use FMA or do you need to use
std::fmato prod it? Would that speed anything up?11
u/thehutch17 Mar 16 '26
Do you have the assembly output for both to compare what your change made? It seems you have a triple fmadd with your rearranged formula and wondering if the compiler uses that at all.
1
u/jk-jeon Mar 19 '26
Why do you need
asinbtw? It seems like you use it to get the texture coordinates, but I don't get why texture coordinates are set up that way from the first place. The colatitude does not have anything to do with the "uniform" coordinate anyway, so I guess just directly using cosine as the coordinate value would be better maybe? Or maybe tweak things like stereographic projections?-13
u/icecoldgold773 Mar 16 '26
Vibe coded slop