Math2.org Math Tables: Recursive Formulas for B / A

(Math)
Recursive Formulas for B / A
Recursive Formulas for B / A

Explicit form:

Find B/A where B and A are real numbers and B > 0
Recursive form:
Convert B and A to scientific notation base 2 (C++ has function "frexp" for this). Note: mantissa is ³ .5 and < 1.

Let

a = mantissa of A
b = mantissa of B
exp = exponent of b - exponent of a
x0 = 1
xn+1 = xn(2 - a xn)
Reiterate x until desired precision reached. Result only has to be close, not perfect. I suggest about 5 times.
y0 = b xn
yi+1 = yi + xn(b - a yi)
Reiterate y until desired precision reached.

B / A = yi * 2exp

Example: 314.51 / 5.6789
Written in base-2 scientific notation:
B = 0.61357421875 * 29
A = 0.7098625 * 23
exp = 9 - 3 = 6
iterationvalue
x01
x11.2901375
x21.398740976607287
x31.408652781763906
x41.408723516847958
(will use this value for x)
iterationvalue
y00.864356431284738
y10.864356433463227
y20.864356433463227
y30.864356433463227
y40.864356433463227
y50.864356433463227

B / A = 0.864356433463227 * 26 =
55.318811741710538

55.318811741710538 (true value)

Source: Jeff Yates, et al.