Maths encyclopedia and lessons  
Search

Mathematics Encyclopedia and Lessons

 
     
 

Lessons

Popular
Subjects

algebra
arithmetic
calculus
equations
geometry
differential equations
trigonometry
number theory
probability theory
more
 

References

applied mathematics
mathematical games
mathematicians
more
 
 

N-th root algorithm

The principal n-th root \sqrt[n]{A} of a positive real number A, is the positive real solution of the equation

xn = A

(For integer n there are n distinct complex solutions to this equation if A > 0, but only one is positive).

There is a very fast-converging n-th root algorithm for finding \sqrt[n]{A}:

  1. Make an initial guess x0
  2. Set x_{k+1} = \frac{1}{n} \left[{(n-1)x_k +\frac{A}{x_k^{n-1}}}\right]
  3. Repeat step 2 until the desired precision is reached.

This is a generalization of the well-known square-root algorithm. By setting n = 2, the iteration rule in step 2 becomes the more familiar square root iteration rule:

x_{k+1} = \frac{1}{2}\left(x_k + \frac{A}{x_k}\right)

Several different derivations of this algorithm are possible. One derivation shows it is a special case of Newton's method (also called the Newton-Raphson method) for finding zeros of a function f(x) beginning with an initial guess. Although Newton's method is iterative, meaning it approaches the solution through a series of increasingly-accurate guesses, it converges very quickly. The rate of convergence is quadratic, meaning roughly that the number of bits of accuracy doubles on each iteration (so improving a guess from 1 bit to 64 bits of precision requires only 6 iterations). For this reason, this algorithm is often used in computers as a very fast method to calculate square roots.

For large n, the n-th root algorithm is somewhat less efficient since it requires the computation of x_k^n at each step, but can be efficiently implemented with a good exponentiation algorithm.

Derivation from Newton's Method

Newton's method is a method for finding a zero of a function f(x). The general iteration scheme is:

  1. Make an initial guess x0
  2. Set x_{k+1} = x_k - \frac{f(x_k)}{f'(x_k)}
  3. Repeat step 2 until the desired precision is reached.

The n-th root problem can be viewed as searching for a zero of the function

f(x) = xn - A

So the derivative is

f^\prime(x) = n x^{n-1}

and the iteration rule is

x_{k+1} = x_k - \frac{f(x_k)}{f'(x_k)}
= x_k - \frac{x_k^n - A}{n x_k^{n-1}}
= x_k - \frac{x_k}{n}+\frac{A}{n x_k^{n-1}}
= \frac{1}{n} \left[{(n-1)x_k +\frac{A}{x_k^{n-1}}}\right]

Leading to the general n-th root algorithm:

01-04-2007 01:18:14
The contents of this article are licensed from Wikipedia.org
under the GNU Free Documentation License. How to see transparent copy