How might I find a root-seeking program's "order of convergence"?
For an iteration program, how might I examine the effect of the rounding-error? (If MATLAB displays the iterates to 4 d.p., does that mean it is working with that level of accuracy or does it work with more digits internally?)
Thanks.
You will need to find out which algorithm the program implements. The bisection method has a linear convergence, and Newton iterations has quadratic convergence.
MATLAB works with normal 8 byte floating point numbers (double), which has precision down to about 16 decimals (or rather, exactly 52 decimals position in binary). In matlab, the function
eps(x)will give you the smallest possible increment for the valuex. The value displayed corresponds to an increment of the least significant decimal. Note that you cannot exactly describe even just 0.1 in binary, as you can try for yourself in MATLAB:fprintf('%.20e\n',0.1)will result in1.00000000000000005551e-01which is the closest binary representation.