function ge2(A)
% 
% Pre:  A is a 2-by-2 matrix that can be represented exactly
%       with 3-digit mantissas.
%
% Post: Displays information about 3-digit Gaussian elimination
%       applied to A.
%
 
clc

condA = cond(A);

a11 = Represent(A(1,1));
a12 = Represent(A(1,2));
a21 = Represent(A(2,1));
a22 = Represent(A(2,2));

b1 = Float(a11,a12,'-');
b2 = Float(a21,a22,'-');

disp(['Stored A =   ' Pretty(a11)  '   ' Pretty(a12) ])
disp(['             ' Pretty(a21)  '   ' Pretty(a22) ])



L11 = Represent(1);
L12 = Represent(0);
L21 = Float(a21,a11,'/');
L22 = Represent(1);

disp(' ');  
disp(['Computed L = ' Pretty(L11)  '   ' Pretty(L12)])
disp(['             ' Pretty(L21)  '   ' Pretty(L22)])


U11 = a11;
U12 = a12;
U21 = Represent(0);
U22 = Float(a22,Float(L21,a12,'*'),'-');

disp(' '); 
disp(['Computed U = ' Pretty(U11)  '   ' Pretty(U12)])
disp(['             ' Pretty(U21)  '   ' Pretty(U22)])




y1 = b1;
y2 = Float(b2,Float(L21,y1,'*'),'-');
x2 = Float(y2,U22,'/');
x1 = Float(Float(y1,Float(U12,x2,'*'),'-'),U11,'/');

xe1 = Represent(1);
xe2 = Represent(-1);

disp(' ');
disp(['Exact b           =  '  Pretty(b1) ])
disp(['                     '   Pretty(b2)  ])


disp(' '); 
disp(['Exact Solution    =  '  Pretty(xe1) ])
disp(['                    '   Pretty(xe2)  ])

disp(' '); 
disp(['Computed Solution =  ' Pretty(x1)])
disp(['                    '  Pretty(x2)])

disp(sprintf('\ncond(A) = %5.3e',condA))


xtilde = [Convert(x1);Convert(x2)];
x = [1;-1];
b = A*x;
r = A*xtilde-b;
E = -r*xtilde'/(xtilde'*xtilde);

disp(' ');
disp('Computed solution solves (A+E)*x = b where')

disp(sprintf('\n                   E =  %12.6f %12.6f',E(1,1),E(1,2)));
disp(sprintf('                        %12.6f %12.6f',E(2,1),E(2,2)));
disp(' ')

  return
end

