Question: def newton ( func , x 0 , ftol = 1 e - 1 2 , xtola = 1 e - 7 , maxiter =

def newton(func, x0, ftol=1e-12, xtola=1e-7, maxiter=100):
func is a Python function that takes in x and returns f(x) and f'(x), in that order.
For example
f, df = func (x)
x0 is an initial guess for the root.
ftol is tol ?f in Criterion 2, xtola is tol ?x in Criterion 1.
maxiter is the maximum number of iterations allowed.
Use a while loop in the function, and return both the estimated root and the
number of iterations used in the while loop.
def newton ( func , x 0 , ftol = 1 e - 1 2 ,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!