HackerTube.dev

Fast Inverse Square Root — A Quake III Algorithm

Nemean · 6M views · 2020-11-28 · 20:08

Open on YouTube ↗

If playback is restricted in your region, try opening the original video. Use Mark watched to add it to your marked videos.

Overview

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.

On Hacker News

HN recommends it as an approachable explanation that makes the famous algorithm finally make sense.

Recommended by 3 HN people across 3 months · HN mentions 2021–2022

Topics

Search by tags

What people said

greyfox · 2021-07 · Strong recommendation

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]

Read the original HN comment ↗
infogulch · 2021-09 · Recommendation

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]

Read the original HN comment ↗
colejohnson66 · 2021-08 · Recommendation

> 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)

Read the original HN comment ↗

Sources

Video by Nemean, played through YouTube.

Data and selection notes

HN summaries and labels may contain AI errors. HN dates refer to discussions, not video publication.

HN Library: HackerTube export (2026-10-31) and open-index/hacker-news. Upstream summaries and classifications may contain AI errors.

Views, duration and playback status refresh separately from the published catalog. When an update fails, existing data remains visible.

Selection checks
  • SaaS & AI candidates: Topic keywords do not match
  • Editor-approved picks: Editorial review is required

Rule matches identify candidates. They do not guarantee video quality or financial results.

About the library and its sources