Unformatted text preview: % fL = f(L); fR = f(R); tol = 10^-6*(R-L); while abs(R-L) > tol mid = (L+R)/2; fmid = f(mid); if fL*fmid<=0 % There is a root in [L,mid]. R = mid; fR = fmid; else % There is a root in [mid,R]. L = mid; fL = fmid; end end xStar = (L+R)/2;...
View Full Document
This note was uploaded on 09/12/2009 for the course CS 100 taught by Professor Fan/vanloan during the Fall '07 term at Cornell.
- Fall '07