Settings

Theme

Fast Inverse Square Root

en.wikipedia.org

6 points by WhiteDawn 12 years ago · 3 comments

Reader

ColinWright 12 years ago

OK, one very last time. Here are a few previous submissions of this, some of which have comment:

https://news.ycombinator.com/item?id=213056 : Some comments

https://news.ycombinator.com/item?id=419166 : Some comments

https://news.ycombinator.com/item?id=573912

https://news.ycombinator.com/item?id=1599635

https://news.ycombinator.com/item?id=2332793 : Some comments

https://news.ycombinator.com/item?id=3115168 : Some comments

https://news.ycombinator.com/item?id=3259199

https://news.ycombinator.com/item?id=4526609 : Some comments

https://news.ycombinator.com/item?id=4836589

https://news.ycombinator.com/item?id=6106627

https://news.ycombinator.com/item?id=7277215

https://news.ycombinator.com/item?id=7297582

hehaho 12 years ago

For a second I was expecting this to be an April Fool's post about a "fast" way to calculate the inverse of the square root function, i.e. x*x :-)

jtlien1 12 years ago

A lot of times, the code you are writing does distance comparisons to determine overlap or intersection. But if all you are doing is this, then you can use the square of the distance which is just x^2 + y^2 and you have no need for a square root. Some mathematicians call this "quadrance". Or just do all your work in this metric and reserve the square rooting for when it is absolutely necessary.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection