Lab Five

Results Summary

BISECTION sin(5x)/xcos(x)-x
iterations1210
result 2.510.739
accuracy 1E-31E-3


SECANT sin(5x)/xcos(x)-x
iterations23
result 3.1414.739
accuracy 1E-31E-3

Bisection

>>> rootfinder.bisect(0,1,rootfinder.cosf)
[0.7392578125, 10]
>>> rootfinder.bisect(1,3.15,rootfinder.sinf)                    
[2.5132934570312502, 12]

Secant

>>> rootfinder.secant(0,1,rootfinder.cosf)
[0.73911936191162919, 3]
>>> rootfinder.secant(1,3.15,rootfinder.sinf)
[3.1414236375956812, 2]