Fast inverse square root for computer graphics programming! [1] Popularized by leaked Quake III code (attributed to John Carmack), but dates back much further.
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!
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?
Many past discussions on HN: https://hn.algolia.com/?q=inverse+square+root
reply