18 comments

[ 2.0 ms ] story [ 56.0 ms ] thread
Pot meet kettle. ;)

http://news.ycombinator.com/item?id=419166

Or is this something intentional?

Hah! I'm glad you replied so I can say thanks for your kind comment earlier.

Thank you.

And this is indeed something intentional. I continue to explore the community, as well as trying to provide value. I don't duplicate things unless I think there is genuine value, and this is (a) very old, (b) really cool, and (c) genuinely hacking.

Thanks for noticing. More details if you email me, but I've got a large backlog at the moment so won't reply immediately.

How long is it before you can dupe something? A while back, I tried to submit a cool little list of bit hacks, only to find out that the exact same thing had been submitted years ago.

I guess many people probably know about it, but it's a pretty nice list of low level bit hacks:

http://graphics.stanford.edu/~seander/bithacks.html

Not a dupe:

The other thread's url: betterexplained.com/articles/understanding-quakes-fast-inverse-square-root/

This's url: betterexplained.com/articles/understanding-quakes-fast-inverse-square-root

One character as difference: the final slash.

Good catch!

I guess no one can submit that list of bit hacks ever again, unless the dupe-catcher is changed or someone figures out a way to access it from an alternate URL (the site says we're not free to mirror it, even if we're free to use the hacks).

I remember when this came up on gamedev.net many years ago and Chris Lomont (who, at least at the time - don't know about now, was a regular on the gamedev.net forums) came up with his paper explaining why this works (and coming up with a better constant). Brings me back :-P

Of course, this site is so much easier to understand than Chris' paper.

The history of this function (posted on Beyond3D[1]) is facinating too.

[1] Part 1: http://www.beyond3d.com/content/articles/8/ and part 2: http://www.beyond3d.com/content/articles/15/

The reason this site is easier to understand than the quoted paper is, of course, that it explains everything but the interesting part which is the subject of the paper.
True. I would love an idiot-explanation of that, so that I can understand it too.
Unfortunately the magic number is still magic, even though I read the paper linked at the bottom. Can anyone summarize the reason that number works well?
And of course, they skip over the only part I don't understand about that hack. The real meat and potatoes, the magic number.
Heh, yeah. I believe Chris Lomonts paper talks about how it was derived (at least, he derives a new one, so I guess he must have figured it out - it went over my head though)
(comment deleted)
I always thought "inverse" square root was a misnomer. The actual inverse of the square root is the square.

This should either be called multiplicative inverse square root, or reciprocal square root, no?

In the case of the SSE instruction set, it is call reciprocal square root. I guess, when people say inverse, they often actually mean multiplicative inverse.