Question: python inputing this should output .5 2) root = secant(f, x0, x1, acceptableValue) This function takes in the continuous function f with initial guesses of
python
inputing this should output .52) root = secant(f, x0, x1, acceptableValue) This function takes in the continuous function f with initial guesses of x0 and X1. It also takes in the acceptable value error threshold acceptableValue such that the simulation should stop after the approximate relative error is less than the acceptableValue. Note that acceptable Value is in % units. This function then performs the secant method and outputs the root such that f(root) 0. def f(x): return x*2 - 1 print (secant (f,0,10,40))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
