Fast Inverse Square Root — A Quake III Algorithm
Nemean3 HN recommenders · 2021–2022
6M views · explainer · evergreen · Uploaded 2020-11-28
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.
HN recommends it as an approachable explanation that makes the famous algorithm finally make sense.
1:25:348 Bit & '8 Bitish' Graphics-Outside the Box
GDC Festival of Gaming
49:55How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework
Видео с мероприятий {speach!
1:12:27CppCon 2015: Andrei Alexandrescu “std::allocator...”
CppCon
22:21Reverse emulating the NES to give it SUPER POWERS!
suckerpinch
1:02:42Preventing the Collapse of Civilization / Jonathan Blow (Thekla, Inc)
DevGAMM
42:15"Performance Matters" by Emery Berger
Strange Loop Conference
1:01:07The Ultimate Game Boy Talk (33c3)
media.ccc.de
1:48:55The Thirty Million Line Problem
Molly Rocket
4 comments from Hacker News
Very interesting that this was posted as I literally JUST watched an even MORE interesting youtube upload about this very bit of code just last weekend. Here's the very fun video if anyone wants to take a look: [VIDEO]
> The bits of a float as an integer literal are proportional to its log2 value (plus a constant), … I watched a video[0] a while back about that. Once that coincidence(?) was explained, Q_rsqrt finally made sense. [0]: [VIDEO] (~20 minutes)
Apparently the bit pattern of a float interpreted as an int is sorta-kinda it's own logarithm, which is why the famous fast inverse square root from quake 3 works: log(x^-½) = -½log(x) =~ -log(x) >> 1. This video is approachable and explains it pretty well: [VIDEO]
print("Hello World") /s But I've heard good things about the Fast Inverse Square Root Calculation algorithm in the Doom 3 source code. [VIDEO]