format long x1=2; x2=1.8; tol=1e-8; err=1; while (err>tol) fx1=x1^3+4*x1^2-10; fx2=x2^3+4*x2^2-10; slope=(fx1-fx2)/(x1-x2); x3=x2-fx2/slope x1=x2; x2=x3; err=abs((x2-x1)/x2)*100; end root=x3