Skip to content

Comment on Fast inverse square rootparent

Comments

And a very clever zeroth approximation.

Exactly, that's the key to the whole thing.

After all if your first approximation is 'in the ballpark' you get a lot of precision in one go. Newtons method would run 'infinitely long' to reach an arbitrary precision, normally the cutoff is some acceptable error.

By getting within the ballpark on the first try you can get within acceptable error with one more approximation step.

(acceptable depends on the use of the result of course).

AboutSource Built by g1lg1l

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