function x=newton(x0,e) x=x0-f(x0)/fd(x0); while abs(x-x0)>e abs(x-x0); x0=x; x=x0-f(x0)/fd(x0); endwhile end