The Cursed 0x5f3759 Inverse Square Root Hack
3-Second Blueprint (English)
- Quake III accelerated 3D vector normalization by approximating 1/sqrt(x) without costly 1990s floating-point division.
- Casting an IEEE 754 float's bit pattern to an integer approximates a scaled base-2 logarithm, halved via a right bit-shift.
- Subtracting the shifted integer from magic constant 0x5f3759df and casting back to float yields ~99.8% accuracy fast.
Fast Inverse SqrtIEEE 754Bitwise Operations3D Graphics Math
3-Sekunden-Fazit (Deutsch)
- Quake III beschleunigte 3D-Vektornormierungen durch die Näherung von 1/sqrt(x) ohne langsame Gleitkomma-Division.
- Die Umdeutung der IEEE-754-Float-Bits als Integer nähert den Logarithmus zur Basis 2 an, halbiert per Rechts-Bitshift.
- Subtraktion von der Konstante 0x5f3759df und Rückwandlung in Float liefert extrem schnell rund 99,8 % Genauigkeit.
Fast Inverse SqrtIEEE 754Bit-Operationen3D-Grafikmathematik
Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.