u/Drach88in r/C_Programming • Recommends
#fastinversesquareroot#quakeiii#ieee754
Fast Inverse Square Root — A Quake III Algorithm
122K subscribers • 2 videos on Hallway
- Recommended by 5 people: 3 on Hacker News, 1 on Lobsters and 1 in engineering communities.
Intermediate. Assumes working knowledge.
6M views5 years ago5 recommendations
Computer scienceHistory and cultureAlgorithmsMath for programmersHistory of computing
An in-depth explanation of the famous Quake III fast inverse square root algorithm, covering IEEE 754 floating-point representation and Newton's method.
In this video we will take an in depth look at the fast inverse square root and see where the mysterious number 0x5f3759df comes from. This algorithm became famous after id Software open sourced the engine for Quake III. On the way we will also learn about floating point numbers and newton's method. Introduction Why Care? The Code IEEE 754 Bits and Numbers 1st Step: Evil Bit Hack 2nd Step: WTF 3rd Step: Newton Summary Picture of John Carmack is licensed under CC BY 2.0 from author Drew "Prognar" Campbell. Source: flic.kr/p/6YxWYpWhy it's here
5 people recommend thisWhat people say. Highly recommended as an exceptionally clear and approachable explanation of the math and bit hacks behind the Quake III algorithm.
greyfoxon Hacker News • Recommends
On “Copilot regurgitating Quake code, including sweary comments”
Hail_Spacecakeon Lobsters • Recommends
colejohnson66on Hacker News • Recommends
On “One does not simply calculate the absolute value”
infogulchon Hacker News • Recommends
On “Bit Patterns of Float”
u/Turrett_99in r/gameenginedevs • Mentions
u/alex_danikin r/C_Programming • Mentions
On “Weird but legible C programs”
u/deulamcoin r/ProgrammingLanguages • Mentions
bitwidgeton Hacker News • Mentions
On “Ask HN: What's a small example of some of the best code ever written?”
u/daybyter2in r/C_Programming • Mentions
On “What are some of the most insane compiler optimizations that you have seen?”