% Script File: accuracy.m
% Examines residual and errors for a family of linear equation problems.

disp(sprintf(' n    residual    r_bound       error      e_bound'))
for n = 2:2:12
   A = pascal(n);
   x = ones(n,1);
   b = A*x;
   x_c = gepp(A,b);
   residual = norm(A*x_c-b);
   r_bound = eps*norm(A)*norm(x_c);
   error = norm(x_c - x)/norm(x);
   e_bound = eps*cond(A);
   disp(sprintf('%2d %12.4e %11.4e %12.4e %11.4e',n,residual,r_bound,error,e_bound))
end
