Publisher Summary This chapter presents an algorithm for computing the inverse square root. In computer graphics calculations, the square root is often followed by a division, as when normalizing vectors. This adds a significant amount of computational overhead, as a floating-point division typically costs much more than multiplication. The cost of division may be mitigated by reciprocation. This chapter derives the method and provides an implementation for directly computing the inverse square root, f(x) = x−½. The algorithm is noteworthy, as no divisions are required. It is based upon the method of successive approximations. The square root may also be computed at the cost of one additional multiplication. The algorithm has two parts—computing an initial estimate, and refining the root by using a fixed number of iterations. The procedure has been exhaustively tested for all single-precision IEEE mantissas lying between 0.5 and 2.0 using IEEE arithmetic.
[1]
Earl E. Swartzlander,et al.
Computer Arithmetic
,
1980
.
[2]
Walt Donovan,et al.
Direct Outcode Calculation for Faster Clip Testing
,
1994,
Graphics Gems.
[3]
Guido D. Salvucci,et al.
Ieee standard for binary floating-point arithmetic
,
1985
.
[4]
A. Ralston.
A first course in numerical analysis
,
1965
.
[5]
Steve Hill.
Ieee Fast square root
,
1992,
Graphics Gems III.
[6]
Kai Hwang,et al.
Computer arithmetic: Principles, architecture, and design
,
1979
.
[7]
Paul Lalonde,et al.
A high speed low precision square root
,
1990
.