Question: please help me to write a python code base on the Newton's method. The algorithm for Newton's method follows: Initialize guess to x/2 While guess
please help me to write a python code base on the Newton's method.
The algorithm for Newton's method follows:
Initialize guess to x/2 While guess is not good enough do update guess to be the average of guess and x/guess
When this algorithm completes, guess contains an approximation of the square root.The quality of the approximation depends on how you define "good enough". In this exercise, guess was considered good enough when the absolute value of the difference between guess * guess and x was less than or equal to 10^-12.
Here's the code I should start with:
def find_sqrt(x): # start your code below
Could you please help me to finish the code by following the algorism above?
Thanks!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
