Computer Project 1

Due: in class, Monday September 10, 2001 .

Catastrophic cancellation or loss of significant digits can occur due to roundoff error in using a floating point number system. One must be on guard to avoid situations that can lead to cancellation. This includes re-formulating equations, increasing floating point precision, and minimizing the number of calculations.

The purpose of this project is to demonstrate the occurrence of cancellation and illustrate the effect of preventative measures. We consider the simple function on the interval (0.99, 1.01). This seems harmless enough!

  1. Maple allows the precision of its floating point number system to altered. The default precision of 10. To help illustrate the effect of roundoff error, set the digits (= precision) in Maple to be 6. This is done by the statement Digits:=6; For each of the following parts, generate 101 equally spaced data points for the given functions and generate a graph using Maple.

Comment: You must create a dataset that you then graph. If you use the command plot( f(x) , x=0.99..1.01 ); Maple will use its own dataset using its default hardware setting for the precision that you have no control over.

  1. Plot f(x) on the interval (0.99, 1.01).
  2. Expand f(x) and plot on the interval (0.99, 1.01).
  3. Use Horner's method to evaluate the function in part 3 at the same 101 points.
  4. Write a paragraph describing what you have observed.
  5. Repeat 2--5 but the digits set to be 10.

Some hints on how do this Back to Cover Page