Re:Improving the fast inverse square root (2010)
by piyush_soni on Monday July 09, 2018 @02:27AM
(#17488345)
Thanks, I came here to ask the similar question about native optimizations on this 'hack'. Apologies for my lack of knowledge, but I'm a little confused on which one to use out of all these variants while compiling C++ code on a 64 bit platform for the standard 'float' type inverse square root? Are there varying levels of compromise between speed and accuracy among all these methods? Thanks ...
[ Parent
| on HN ]
Re:Improving the fast inverse square root (2010)
by stephencanon on Monday July 09, 2018 @12:26PM
(#17491403)
For a generic 64b platform, use RSQRTSS/RSQRTPS, since it's the only one that will exist. The others are specific to rather new hardware.
My recollection is that it's accurate to 11.5 bits, so after one refinement step you have nearly full precision (an error bound of a couple ULP). Check Intel's docs for more details.
Re:Improving the fast inverse square root (2010)
by piyush_soni on Tuesday July 10, 2018 @12:09AM
(#17495384)
Thanks!