GS510

Assignment 1 -- Fall 2000

Due date Wednesday September 13, 2000

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:

For a test problem, take the exact solution to be a vector filled with "ones" , x = 1. In which case the right hand side of the linear system is b = A1. This means that the ith entry in the vector b is the sum of the components of the ith row of the matrix A.

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.