Fast inverse square root

Root-finding algorithm

Nº Q32980 ★★★

Rare · History

Fast inverse square root

Root-finding algorithm

Fast inverse square root, sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5F3759DF, is an algorithm that estimates 1 / x {\textstyle 1/{\sqrt {x}}} , the reciprocal (or multiplicative inverse) of the square root of a 32-bit floating-point number x {\displaystyle x} in IEEE 754 floating-point format. The algorithm is best known for its implementation in the 1999 video game Quake III Arena.

Last price

—

Floor price

—

7-day median

—

30-day sales

0

30-day range

—

In circulation

0

Price history

Show table
Datemedian LowHighsales

Sales history

Last sale
—
30-day average
—
30-day low
—
30-day high
—
Sales 7d
0
Sales 30d
0

No sales yet.

Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.

№ Numbered editions · 0 minted Next #1 · Score ×3
From Wikipedia

Fast inverse square root, sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5F3759DF, is an algorithm that estimates 1 / x {\textstyle 1/{\sqrt {x}}} , the reciprocal (or multiplicative inverse) of the square root of a 32-bit floating-point number x {\displaystyle x} in IEEE 754 floating-point format. The algorithm is best known for its implementation in the 1999 video game Quake III Arena. With subsequent hardware advancements, especially the x86 SSE instruction rsqrtss, this algorithm is not generally the best choice for modern computers, though it remains an interesting historical example. The algorithm accepts a 32-bit floating-point number as the input and stores a halved value for later use. Then, treating the bits representing the floating-point number as a 32-bit integer, a logical shift right by one bit is performed and the result subtracted from the number 0x5F3759DF, which is a floating-point representation of an approximation of 2 127 {\textstyle {\sqrt {2^{127}}}} . This results in an initial guess of the inverse square root of the input. Treating the bits again as a floating-point number, it runs one iteration of Newton's method, yielding a more precise approximation.

Text: Wikipédia, CC BY-SA 4.0. · Image: Jann.poppinga (CC0) ·

Related cards

Confirmation