background preloader

Mathematics

Facebook Twitter

Understanding Quake’s Fast Inverse Square Root. An article and research paper describe a fast, seemingly magical way to compute the inverse square root (1/sqrt(x)), used in the game Quake.

Understanding Quake’s Fast Inverse Square Root

I'm no graphics expert, but appreciate why square roots are useful. The Pythagorean theorem computes distance between points, and dividing by distance helps normalize vectors. (Normalizing is often just a fancy term for division). 3D games like Quake divide by distance zillions (yes zillions) of times each second, so "minor" performance improvements help immensely.

We don't want to take the square root and divide the regular way: exponentiation and division are really, really expensive for the CPU. Game theory. Game theory is the study of strategic decision making.

Game theory

Specifically, it is "the study of mathematical models of conflict and cooperation between intelligent rational decision-makers. Knol: a unit of knowledge.