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

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

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 Databases Questions!