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

Click For Summary

Homework Help Overview

The discussion revolves around using Newton's method to compute \(1/\sqrt{a}\) on a simple processor that only supports basic arithmetic operations and halving. Participants explore how to adapt the traditional algorithm for square root calculation to fit the constraints of the processor.

Discussion Character

  • Exploratory, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • Participants discuss deriving a Newton-based algorithm that avoids division, with one suggesting the use of a reciprocal \(A = 1/a\) and another proposing to solve \(f(x) = a - 1/x^2\) directly. Questions arise about how these approaches lead to the desired computation of \(1/\sqrt{a}\).

Discussion Status

There is an ongoing exploration of different methods to achieve the computation, with some participants expressing uncertainty about the derivation of the equations and their implications. One participant believes they have made progress in understanding the iterative formula, while another suggests a simpler approach that aligns with the goal.

Contextual Notes

Participants are working within the constraints of a processor that does not support division, which influences their approach to formulating the problem and finding solutions.

Scootertaj
Messages
97
Reaction score
0

Homework Statement


The most commonly used algorithm for computing [itex]\sqrt{a}[/itex] 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/[itex]\sqrt{a}[/itex] (it then only remains to multiply by a to get [itex]\sqrt{a}[/itex].

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/[itex]\sqrt{a}[/itex] ?
Moreover, how do they get to the equation?
 
Physics news on Phys.org
Scootertaj said:

Homework Statement


The most commonly used algorithm for computing [itex]\sqrt{a}[/itex] 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/[itex]\sqrt{a}[/itex] (it then only remains to multiply by a to get [itex]\sqrt{a}[/itex].



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/[itex]\sqrt{a}[/itex] ?
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).
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
1
Views
3K
  • · Replies 12 ·
Replies
12
Views
6K
Replies
9
Views
3K
Replies
2
Views
6K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K