Question: 3.13 The divide and average method, an old-time iterative method for approximating the square root of any positive number,7 a, can be formulated as
3.13 The "divide and average" method, an old-time iterative method for approximating the square root of any positive number,7 a, can be formulated as xi +alxi 2 where the subscripts indicate iteration i to i + 1. The relative change term from one iteration to the next can be described as Xi+1-xil Xi+1 Xi+1 = Ei+1 = x 100% Write a well-structured Python function based on a while...break loop. Repeat the loop until the relative change is less than a specified tolerance. Test your program for a tolerance of 0.0001% and a values of 2, 10 and -3. For negative values of a, your function should return the imaginary result, that is, -4 returns a value close to 2j. Hint: You can create an imaginary value from a real value by multiplying it by 1j.
Step by Step Solution
There are 3 Steps involved in it
The code is equivalent to the Newton Raphson method becau... View full answer
Get step-by-step solutions from verified subject matter experts
