This assignment deals with a linear system of equations, Ax=b, where A is the Hilbert matrix. The assignment will provide you an opportunity to
(i) compare 32 bit, 64 bit and 128 bit precision in some numerical calculations;
(ii) explore the relationship between residuals and errors in the numerical solution of an ill-conditioned system of linear equations and
(iii) question when you should or should not trust the results produced by a computer program.
Consider a system of n linear equations of the form Ax = b where the matrix A is the Hilbert matrix of order n. The entries in the hilbert matrix are defined to be:
1. Make a local copy of the file
For background on numerical precision issues, see Sun's Numerical Computation Guide Compile and execute the code you selected (just to get familiar with the code).
2. Define all floating point variables in your code hilbert.* to have a size of 32 bits (IEEE single precision). Run the code for linear systems of size 3, 6, 9, 12, 15, 20, 25 and 30. After each run record the information necessary to complete Tables 1 and 2.
3. Define all floating point variables in your code hilbert.* to have a size of 64 bits (double precision). Run the code for linear systems of size 3, 6, 9, 12, 15, 20, 25 and 30. After each run record the information necessary to complete Tables 1 and 2.
4. Define all floating point variables in your code hilbert.* to have a size of 128 bits(extended precision). Run the code for linear systems of size 3, 6, 9, 12, 15, 20, 25 and 30. After each run record the information necessary to complete Tables 1 and 2.
5. From the computer runs in problems 2-4, collect the necessary information to fill in the following table.
Table 1: Residual of maximum absolute value ------------------------------------------------------ 32 bits 64 bits 128 bits ------------------------------------------------------- n = 3
n = 6
n = 9
n = 12
n = 15
n = 20
n = 25
n = 30
Table 2: Error of maximum absolute value ------------------------------------------------------- 32 bits 64 bits 128 bits ------------------------------------------------------- n = 3
n = 6
n = 9
n = 12
n = 15
n = 20
n = 25
n = 30