Root-finding algorithms

Fast inverse square root

Fast inverse square root, sometimes referred to as Fast InvSqrt or by the hexadecimal constant 0x5F3759DF, is an algorithm that estimates , the reciprocal (or multiplicative inverse) of the square root of a 32-bit floating-point number in IEEE 754 floating-point format. This operation is used in digital signal processing to normalize a vector, such as scaling it to length 1. For example, computer graphics programs use inverse square roots to compute angles of incidence and reflection for lighting and shading. Predated by similar video game algorithms, this one is best known for its implementation in 1999 in Quake III Arena, a first-person shooter video game heavily based on 3D graphics. The algorithm only started appearing on public forums between 2002 and 2003. Computation of square roots usually depends upon many division operations, which for floating point numbers are computationally expensive. The fast inverse square generates a good approximation with only one division step. 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 (in decimal notation: 1,597,463,007), which is a floating-point representation of an approximation of . This results in the first approximation 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. The algorithm was often misattributed to John Carmack, but in fact the code is based on an unpublished paper by William Kahan and K.C. Ng circulated in May 1986. The original constant was produced from a collaboration between Cleve Moler and Gregory Walsh, while they worked for Ardent Computing in the late 1980s. With subsequent hardware advancements, especially the x86 SSE instruction rsqrtss, this method is not generally applicable to general purpose computing, though it remains an interesting example both historically and for more limited machines, such as low-cost embedded systems. However, more manufacturers of embedded systems are including trigonometric and other math accelerators such as CORDIC, avoiding the need for such algorithms. (Wikipedia).

Fast inverse square root
Video thumbnail

Inverse Variation: The Square Root of x.

This video explains an inverse variation involving the square of x. http://mathispower4u.com

From playlist Solving Direct and Inverse Variation Problems

Video thumbnail

Ex: Find the Inverse of a Square Root Function with Domain and Range

This video explains how to find the domain and range of a square root function, how to find the inverse of a square root function, and find the domain and range of the inverse function. Site: http://mathispower4u.com Blog: http://mathispower4u.com

From playlist Determining Inverse Functions

Video thumbnail

How to solve a quadratic using the square root method with fraction

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Video thumbnail

How to solve a quadratic equation by using the square root method with irrational solutions

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Video thumbnail

Solving using the square root method with fractions

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Video thumbnail

Solving an equation by using the square root property - Math help

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Video thumbnail

Solving a quadratic equation using inverse operations

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Video thumbnail

Finding the inverse of a 2x2 matrix

In this video I show you one method of calculating the inverse of a square matrix. We can use this inverse to solve for a system of linear equations. Mathematica has a function called Inverse that easily calculates the inverse of a matrix. You can learn more about Mathematica on my Udem

From playlist Introducing linear algebra

Video thumbnail

Fast Inverse Square Root — A Quake III Algorithm

In this video we will take an in depth look at the fast inverse square root and see where the mysterious number 0x5f3759df comes from. This algorithm became famous after id Software open sourced the engine for Quake III. On the way we will also learn about floating point numbers and newton

From playlist Summer of Math Exposition Youtube Videos

Video thumbnail

MegaFavNumbers | The magic number and the legendary fast inverse square root hack.

Hi! I'm Rodrigo Aldana. This is my contribution to the #MegaFavNumbers project. This video is based on a presentation I gave some time ago about the fast inverse square root algorithm but now focused on the related magic number 1597463007. I want to make something clear: 1597463007 is not

From playlist MegaFavNumbers

Video thumbnail

Worldwide Calculus: Inverse Trig Functions

Lecture on 'Inverse Trig Functions' from 'Worldwide Differential Calculus' and 'Worldwide AP Calculus'. For more lecture videos and $10 digital textbooks, visit www.centerofmath.org.

From playlist Worldwide Single-Variable Calculus for AP®

Video thumbnail

Solving an equation by taking the square root of a fraction

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Video thumbnail

Related quantities have related rates of change -- Calculus I

This lecture is on Calculus I. It follows Part I of the book Calculus Illustrated by Peter Saveliev. The text of the book can be found at http://calculus123.com.

From playlist Calculus I

Video thumbnail

The Fast Fourier Transform (FFT): Most Ingenious Algorithm Ever?

In this video, we take a look at one of the most beautiful algorithms ever created: the Fast Fourier Transform (FFT). This is a tricky algorithm to understand so we take a look at it in a context that we are all familiar with: polynomial multiplication. You will see how the core ideas of t

From playlist Fourier

Video thumbnail

Lec 23 | MIT 18.085 Computational Science and Engineering I

Fast fourier transform and circulant matrices A more recent version of this course is available at: http://ocw.mit.edu/18-085f08 License: Creative Commons BY-NC-SA More information at http://ocw.mit.edu/terms More courses at http://ocw.mit.edu

From playlist MIT 18.085 Computational Science & Engineering I, Fall 2007

Video thumbnail

Simplifying Surds (1 of 2: Squares vs. square roots)

More resources available at www.misterwootube.com

From playlist Further Indices

Video thumbnail

Lec 30 | MIT 18.085 Computational Science and Engineering I, Fall 2008

Lecture 30: Discrete Fourier series License: Creative Commons BY-NC-SA More information at http://ocw.mit.edu/terms More courses at http://ocw.mit.edu

From playlist MIT 18.085 Computational Science & Engineering I, Fall 2008

Video thumbnail

26. Complex Matrices; Fast Fourier Transform

MIT 18.06 Linear Algebra, Spring 2005 Instructor: Gilbert Strang View the complete course: http://ocw.mit.edu/18-06S05 YouTube Playlist: https://www.youtube.com/playlist?list=PLE7DDD91010BC51F8 26. Complex Matrices; Fast Fourier Transform License: Creative Commons BY-NC-SA More informati

From playlist Fourier

Video thumbnail

AQC 2016 - Quantum Annealing via Environment-Mediated Quantum Diffusion

A Google TechTalk, June 27, 2016, presented by Vadim Smelyanskiy (Google) ABSTRACT: We show that quantum diffusion near the quantum critical point can provide an efficient mechanism of quantum annealing. It is based on the diffusion-mediated recombination of excitations in open systems f

From playlist Adiabatic Quantum Computing Conference 2016

Video thumbnail

Using the square root method to solve a quadratic equation

👉Learn how to solve quadratic equations using the square root method. It is important to understand that not all quadratics have to be solved using factoring or quadratic formula. When we only have one variable but it is squared we can just use inverse operations to isolate the variable.

From playlist Solve Quadratic Equations by Factoring

Related pages

Single-precision floating-point format | Hexadecimal | Type conversion | Unit vector | Methods of computing square roots | Zero of a function | Angle of incidence (optics) | Union type | Derivative | Normal number (computing) | Halley's method | CORDIC | Normalized number | Floating-point arithmetic | Approximation error | Dimension (vector space) | Exponent bias | Integer (computer science) | Logical shift | Transform, clipping, and lighting | Approximation theory | Digital signal processing | Uniform norm | Rate of convergence | Square root | Binary logarithm | IEEE 754-1985 | Newton's method | Bitwise operation | Multiplicative inverse