Newton-Raphson Division

from Wikipedia, the free encyclopedia

The Newton – Raphson division method uses the Newton method to find the reciprocal value of a denominator and to multiply it by a numerator for the result of the quotient .

Because of its particular importance for computer technology, the procedure is presented below for the dual system . But it can also be used on any other basis.

steps

The steps of the Newton – Raphson division method are:

  1. Finding a first approximation for the reciprocal of the denominator .
  2. Calculate ever better approximations of the reciprocal. The Newton method is used here.
  3. Calculating the quotient by multiplication of the counter with the reciprocal value of the denominator: .

Newton's method

The application of Newton's method requires a function that has a zero at . The obvious function has trivial derivatives that are unsuitable for Newton's method . One useful function is with . Because of this , the graph of the function intersects the axis transversely, i.e. H. non-touching. For which the Newton iteration is

,

which can be calculated starting from exclusively via multiplication and subtraction (or two fused multiply-add operations).

Convergence speed

If the fault is defined as then:

This squaring of the error at each step - the so-called quadratic convergence of Newton's method - ensures that the number of correct digits roughly doubles with each iteration ; a property that is particularly valuable when calculating with long numbers .

Since the speed of convergence is exactly quadratic for this method , it follows that

Steps are sufficient for a precision of binary digits. That's 3 for single and 4 for both double and extended precision IEEE 754 formats .

Finding a first approximation

By bit shifts the denominator can the interval be brought. The counter should experience the same number of shifts so that the quotient remains unchanged. After that one can do a linear approximation of the shape

  with     and  

apply to initiate the procedure.

The coefficients and this linear (polynomial degree 1) approximation result as follows. The relative error is . The minimum value of the maximum error in such an interval is given by the alternant set of Chebyshev applied to the function . The local extremum of takes place when is what the solution has. According to the said alternant set needs this function at the extremum (inside) the opposite sign than at the edges of the interval, have so . For the two unknowns in the two equations, the solution is and , and the maximum relative error is . According to this approximation, the relative error is the initial value

Pseudocode

The following computes the quotient of and to an accuracy of binary digits:

Drücke N aus als M × 2e mit 1 ≤ M < 2 (Standard-Gleitkomma-Darstellung)
N' := N / 2e+1             // Bitverschiebungen resp. Verkleinerung des Exponenten
Z' := Z / 2e+1
X := 48/17 − 32/17 × N'   // erste Näherung mit der gleichen Genauigkeit wie N
repeat  times   // kann für fixes P vorausberechnet werden
    X := X + X × (1 - N' × X)
end
return Z' × X

For a double-precision floating point division, for example, this method requires 10 multiplications, 9 additions and 2 shifts.

literature

Similar procedures