How to Use Newton's Method for Computing 1/\sqrt{a} for a Simple Processor

Scootertaj
Messages
97
Reaction score
0

Homework Statement


The most commonly used algorithm for computing \sqrt{a} is the recursion xn+1 = 1/2 (xn + a/xn), easily derived by means of Newton's method. Assume that we have available to us a very simple processor which only supports addition, subtraction, multiplication, and halving (a subtraction of one in the exponent), but not a general divide operation. Devise a Newton-based algorithm for this processor to compute 1/\sqrt{a} (it then only remains to multiply by a to get \sqrt{a}.

Homework Equations


xn+1 = 1/2 (xn + a/xn)
xn+1 = xn - f(xn)/f'(xn)

The Attempt at a Solution


I found something that says the following:
Essentially try to compute a single reciprocal A = 1/a and
then solve f(x) = 1/x^2 - A = 0 (whose solution is x = sqrt(a))
iteratively using Newton's method:
xn+1 = (xn) (3 - A (xn)^2) / 2

I can see how this gets rid of the division, and we can account for the halving by subtracting one in the exponent, but how does this solve for 1/\sqrt{a} ?
Moreover, how do they get to the equation?
 
Physics news on Phys.org
Scootertaj said:

Homework Statement


The most commonly used algorithm for computing \sqrt{a} is the recursion xn+1 = 1/2 (xn + a/xn), easily derived by means of Newton's method. Assume that we have available to us a very simple processor which only supports addition, subtraction, multiplication, and halving (a subtraction of one in the exponent), but not a general divide operation. Devise a Newton-based algorithm for this processor to compute 1/\sqrt{a} (it then only remains to multiply by a to get \sqrt{a}.



Homework Equations


xn+1 = 1/2 (xn + a/xn)
xn+1 = xn - f(xn)/f'(xn)


The Attempt at a Solution


I found something that says the following:
Essentially try to compute a single reciprocal A = 1/a and
then solve f(x) = 1/x^2 - A = 0 (whose solution is x = sqrt(a))
iteratively using Newton's method:
xn+1 = (xn) (3 - A (xn)^2) / 2

I can see how this gets rid of the division, and we can account for the halving by subtracting one in the exponent, but how does this solve for 1/\sqrt{a} ?
Moreover, how do they get to the equation?

Skip finding the single reciprocal. Just use Newton's method to solve f(x)=a-1/x^2. The solution to that is x=1/sqrt(a), yes?
 
Update: I figured out I believe... This is what I did:

xn+1 = xn - f(xn) / f'(xn) = xn - (1/xn2 - A)(-xn3/2) = xn - xn(-1/2 + Axn2) = xn(1+1/2-Axn2) = xn/2 * (3-Axn2).
 
Last edited:
Dick said:
Skip finding the single reciprocal. Just use Newton's method to solve f(x)=a-1/x^2. The solution to that is x=1/sqrt(a), yes?

Ahh, that would make it easier, I'll go with that! (afterall, it gives the same solution).
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top