MATH 2370 Lecture Notes - Lecture 19: Round-Off Error, Scalar Multiplication, Matlab

9 views3 pages

Document Summary

If f(a) and f(b) have different signs, then there must be a root between those two values see bisection. m. "break" terminates the loop if somehow hit the root (if c==0 break) break also stops for loop, but does not stop entire code. Loop stops with last error check that is small enough, but tol may be too small or there may be roundoff error stop when a maxit (maximum # of iterations) is reached, or tol reached, whichever comes first. You might "hit" the root along the way, i. e. , f(c) could be 0 *(see above) : false position estimate - root of secant line. How to compute ? use a slope formula: (f(b)-0)/(b-( )) = ((f(b)-f(a))/(b-a)) Note: we must change the error measure max error for c is (b-a)/2 max error for c_f is (b-a) To change bisection to false position i. ii. replace c with cf (above) replace (b-a)/2 with (b-a)