home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!sun-barr!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!rz.uni-karlsruhe.de!ipfs.bau-verm.uni-karlsruhe.de!vhansen
- From: vhansen@ipfs.bau-verm.uni-karlsruhe.de (Wolfgang von Hansen)
- Subject: Re: Square root of a number
- Message-ID: <1992Nov18.114710.28333@rz.uni-karlsruhe.de>
- Sender: usenet@rz.uni-karlsruhe.de (USENET 'No news is bad news' News System)
- Organization: IPF, University of Karlsruhe
- References: <1992Nov15.194049.1@woods.ulowell.edu>
- Date: Wed, 18 Nov 1992 11:47:10 GMT
- Lines: 46
-
- In article <1992Nov15.194049.1@woods.ulowell.edu> buxamusaa@woods.ulowell.edu writes:
- >
- >Please could someone help me with an assignment that I have to do.
- >It is a very general question, though the answer could be quite lengthy.
- >"Discuss methods for finding the square root of a number."
- >
- >What I am looking for are all possible methods/alogrithms for this.
-
- My preferred method for such algorithms is Newtons iteration:
-
- Problem: For a given function f find x, so that f(x) = 0.
-
- f(x)
- Solution: x <- x - -----
- f'(x)
-
- The starting value of x must be chosen near enough to the desired
- result. Otherwise you might get a different result or need quite
- a lot of iterations. Repeat the iteration until the accuracy e
-
- e = |x - x |
- i i-1
-
- is reached. Turning to square root we seek x with
-
- 2 2
- x = sqrt(a) <=> x = a <=> x - a = 0.
-
- 2
- From this we get f(x) = x - a
- f'(x) = 2x.
-
- Filling this into our iteration formula we receive
-
- 2 2 2
- x - a 2x - x + a 1 / a\
- x <- x - ----- = ---------- = - |x + -|
- 2x 2x 2 \ x/
-
- 1 / a\
- <=> x <- - |x + -|
- 2 \ x/
-
- I hope that this is helping.
-
- - Wolfgang
-