
% rounding error 

format long 

% rational expressions, stable and unstable
x = 1000;
r1 = x/(x-1) - (x+1)/x 
r2 = 1/(x^2-x)
[1/r1 1/r2]
pause; 

% near linear dependence
A = x^2 + eye(8);
[rank(A), rank(A^2), rank(A^3)]
pause;

% recursion, forward and backward
a(1:2) = [1/x, x]; 
for k=2:10; 
   a(k+1) = 4*a(k) - a(k-1); 
end;
for k=10:-1:2; 
   a(k-1) = 4*a(k) - a(k+1); 
end;
[1/x, x; a(1:2)]

