A Gaussian-elimination-with-partial-pivoting routine solves for a matrix arising from…
PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Scientific programming for physicists · Research software practice, verification and validation
Scientific Computing for Physicists, Ch Is the equation solved right? Testing, debugging and code verification
Problem
A Gaussian-elimination-with-partial-pivoting routine solves Ax=b for a 50×50 matrix A arising from a normal-mode calculation, with condition number κ(A)=3.4×104. The backward-error bound for this class of kernel, derived earlier from the machine epsilon ϵmach=2−52, gives a bound on the relative error of the computed solution of cκ(A)ϵmach, with c=n (the matrix dimension) for this pivoting strategy.
((a)) Derive the tolerance to use in a unit test that compares this routine's output with an independent solve in extended precision, whose own error is negligible beside this routine's, writing it as cκϵmach/2, and give its numerical value.
((b)) The routine's test is to be kept permanently as a regression test that runs automatically on every pull request, in the lockfile environment set up in the repository's continuous-integration job. Explain briefly why the tolerance from part (a), rather than a round number such as 10−6, is what makes this regression test able to fail on a genuine bug (for example a wrong pivot rule) without also failing on harmless rounding differences between machines.