34 printf(‘Did not converge!\n’)
35 out = -1; %dummy value
36 break
37 end
38 f = FunEval(x,a,b,c); %for while loop and next iteration
49 term2 = (-xˆ3 – 3*xˆ2*(1-x))/xˆ6;
50 out = -b*term1 – c*term2;
To see quadratic convergence, I chose an initial guess ǫ(0) =0.1 and a tolerance
of 10−12. The output to screen is
1Starting Newton Method
12 8 0.701500 -3.2950e+02
13 9 0.772616 -6.8457e+01
14 10 0.796499 -5.0679e+00
15 11 0.798564 -3.3613e-02
16 12 0.798578 -1.5037e-06
However, if you know the root, you can go back and check for quadratic conver-
gence. So a better program would be the following: