%  Rounding Error Example
%
%  Ken Jackson    8 Sept. 2008


format long e
   
x = 1.e-13

y = 1. + x - 1.

ry = (y - x) / x

z = 4. + x - 4.

rz = (z - x) / x


% In exact arithmetic, x = y = z, but the computed values are not equal?
% If you run the program above you will get
% 
% x = 1.000000000000000e-13
% 
% y = 9.992007221626409e-14
% 
% ry = -7.992778373591440e-04
% 
% z = 1.003641614261142e-13
% 
% rz = 3.641614261141482e-03
% 
% Can you explain why the relative errors are so large?



