Skip to content

Comment on Creativity is the new moatparent

Comments

The most important part of FINVSQRT is the right shift by one bit. This halves the exponent, which gives the square root to within a factor of 2. Subtraction inverts the exponent since we're looking for an inverse square root. The second most important part is the Newton-Raphson iterations which refine the initial approximation. The most magical seeming part is also the least important: what you do with the mantissa in the initial approximation.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.