Fast Inverse Square Root — A Quake III Algorithm
What it is
A walkthrough of the Quake III fast inverse square root, explaining where the constant 0x5f3759df comes from. It covers IEEE 754 floats, the bit hack that approximates a logarithm, and a Newton's method refinement.
Why Hacker News recommends it
HN recommends it as an approachable explanation that makes the famous algorithm finally make sense.
- 3 people recommended it
- 3 different months
- 1 strong recommendations
- first 2021, last 2022
What HN commenters said
“Here's the very fun video if anyone wants to take a look”
More interesting video about the famous Quake code
greyfox, 2021-07 · Strong recommendation · in “Copilot regurgitating Quake code, including sweary comments”
“Once that coincidence(?) was explained, Q_rsqrt finally made sense.”
Explains float bits as logarithm, making Q_rsqrt make sense
colejohnson66, 2021-08 · Recommendation · in “One does not simply calculate the absolute value”
“This video is approachable and explains it pretty well”
Approachable explanation of why fast inverse square root works
infogulch, 2021-09 · Recommendation · in “Bit Patterns of Float”
Excerpts from Hacker News comments, linked to the originals. Summaries and labels were written by a language model from those comments.
Topics: quake iii, ieee 754, floating point, newton's method, bit hacks
Also recommended by the same people
explainerHow to achieve nanometer precision in space?Breaking Taps · 4 HN recommenders · 2022–2026
demoTWO Unpickable (?) Locks for Lock Picking Lawyer!Stuff Made Here · 3 HN recommenders · 2021–2022
explainerThis is why we can't have nice thingsVeritasium · 4 HN recommenders · 2021–2024
talkThe Future of Mathematics?Microsoft Research · 9 HN recommenders · 2019–2025
demo[1299] Unpickable Locks From Stuff Made HereLockPickingLawyer · 5 HN recommenders · 2021–2022
talkWhy can't you multiply vectors?Freya Holmér · 9 HN recommenders · 2023–2025
explainerFourier Optics used for Optical Pattern RecognitionHuygens Optics · 5 HN recommenders · 2021–2025
lectureRefterm Lecture Part 1 - Philosophies of OptimizationMolly Rocket · 10 HN recommenders · 2021–2026