Question: Thonny - /Users/peytonballou/Downloads/bisect4.py @ STOP Vaule.py VauleEB.py bisect4.py 1 def fun(x): 2 return ***3 - 9 3 4 def bisect(f, a, b, tolerance) : 5

Thonny - /Users/peytonballou/Downloads/bisect4.py @ STOP Vaule.py VauleEB.py bisect4.py 1 def fun(x): 2 return ***3 - 9 3 4 def bisect(f, a, b, tolerance) : 5 while b - a> tolerance: # keep going until a and b get too 6 c = (b+a)/2 # cut the interval in half 7 print(c, f(c)) 8 if f(c) 0: # if c is the root, exit the loop 9 break 10 if f(c)*f(b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
