Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login



sort by: page size:

I was just talking about this paper with a coworker on Friday.

One of the best parts about this code is its initial implementation in Quake III. The comments are especially funny. It's on Wikipedia - https://en.wikipedia.org/wiki/Fast_inverse_square_root


Also related: Quake III fast inverse square root[1].

[1]: https://github.com/id-Software/Quake-III-Arena/blob/master/c...


The famous "fast inverse square root" was in Quake 3.

Relevant Quake engine trivia, for those that are interested:

https://en.m.wikipedia.org/wiki/Fast_inverse_square_root


The Fast Inverse Square Root function from Quake III:

    i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
https://en.wikipedia.org/wiki/Fast_inverse_square_root

Of course there's "Fast Inverse Square Root — A Quake III Algorithm"

[0] https://www.youtube.com/watch?v=p8u_k2LIZyo


finding an approximate root for these purposes can be really quite fast, as was demonstrated in Quake III. https://en.wikipedia.org/wiki/Fast_inverse_square_root

Fast inverse square root for computer graphics programming! [1] Popularized by leaked Quake III code (attributed to John Carmack), but dates back much further.

[1] https://en.wikipedia.org/wiki/Fast_inverse_square_root


Wasn't Quake the one where they did a really good approximation of he inverse square root because they needed it?

Here's a link to the infamous fast inverse square root function: https://github.com/id-Software/Quake-III-Arena/blob/master/c...

It's a shame you picked q3's fast inverse square root. It's not a great example as it turns out someone else implemented it in Quake 3 and someone else entirely devised the algorithm itself. Though you're right - he's a bit of a hero and deservedly so.

edit: however ... I've just read that article and it is actually the most in-depth and interesting analysis I've read on the subject so thanks!


Fast inverse square root as seen in Quake (as mentioned in other comments)

https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overv...


Hm interesting, I knew it from Quake and implicitly assumed that it was Carmack's trick. But Wikipedia has some more history:

https://en.wikipedia.org/wiki/Fast_inverse_square_root#Histo...


Do we have another example than the famous quake fast square root function?

As mentioned in the article, it reminds me of the 0x5f3759df fast inverse square root used in Quake III Arena!

https://medium.com/hard-mode/the-legendary-fast-inverse-squa...

This is where I really see CS as being close to mathematics.


Here’s your fast inverse square root (totally not copied from Quake II Arena). By the way, did you know that I’m a real boy and I’m stuck in a code factory?


Feels very much like an appeal to authority though. Fast inverse square root was discovered/implemented as a side task for a first person shooter: https://en.wikipedia.org/wiki/Fast_inverse_square_root.

I really want to see it explain the famous Quake fast inverse square root, but apparently it's extremely rate limited right now
next

Legal | privacy