function x=intfel(a,b,e) n=ceil(log((b-a)/e)/log(2)) x=(a+b)/2 for i=2:n if f(a)*f(x)>0 a=x else b=x endif (b-a)/2 x=(a+b)/2 endfor endfunction