💻 Codepublished 2w ago
The fast inverse square root constant remained an enigma for years
When id Software open-sourced Quake III Arena in 2005, developers marveled at a bizarre C function that calculated 1/√x up to four times faster than hardware division. The algorithm used the mysterious hexadecimal constant 0x5F3759DF to seed a brilliant bit-level floating-point approximation. Despite widespread attribution to John Carmack, the trick originated decades earlier among engineers at Ardent Computer.
Sources
✨ Sparklet is a feed of fact-checked learning cards like this one.
Join free — start your streak