Math2.org Math Tables: Recursive Formulas for sqrt(A) |
(Math) |
Explicit form:
Find " src="../../art/sqrt.gif">(A), where A is a real number > 0.Recursive form:
Convert A to scientific notation base 2 (C++ has function "frexp" for this). Note: mantissa is ³ .5 and < 1.Source: Jeff Yates.Let
a = mantissa of AReiterate about 5 or 6 times then do y with that result.
exp = exponent of a
a = a * 2(exp mod 2)
exp = exp \ 2 (Note: integer divide)
xn+1 = (xn/2)(3 - axn2)
yi+1 = yi + (xn/2)(a - yi2)Reiterate until required precision attained." src='../../art/sqrt.gif' align=middle>A = yi * 2exp