% play with stability of Gaussian elimination. lec 4 Math 116. Barnett 4/3/14

m=55; A = randn(m,m);
[L,U]=lu(A);
norm(U), norm(L)
norm(A - L*U)/norm(A)  % is bkw stab, even for large m

m=55; A = tril(-ones(m,m))+2*eye(m); A(:,end)=1; % Wilkinson's bad example
A = A + 0*1e-16*randn(m);
[L,U]=lu(A)
norm(U), norm(L)         % growth is 2^m
norm(A - L*U)/norm(A)    % (note exact arith for small m<53)
