Write real function Sqrt(x) to compute the square root of a real argument x by the following algorithm: First, reduce the range of x by finding a real number r and an integer m such that x = 22mr with 1/4 ?r < 1. Next, compute x2 by using three iterations of Newton’s method given by
with the special initial approximation
Then set √ x ≈ 2mx2. Test this algorithm on various values of x. Obtain a listing of the code for the square root function on your computer system. By reading the comments, try to determine what algorithm it uses.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.