CSE541 Homework #4

Answers

Due Date: Jan. 31


GENERAL INSTRUCTIONS


ASSIGNMENT

  1. Prob. 4.3.3 in book (5th edition)
    ans

  2. Prob. 4.8b in book (5th edition)
    ans

  3. You are given a program and Makefile that implements differentiation by forward differencing for the function sin(x2). The executable is invoked with command line arguments for the function parameter value, the starting h value and the number of iterations to perform. Each iteration computes an estimate for the derivative at the value using the current value of h, and then divides h by 10 for the next iteration.

    As examples, and as part of the assignment, run the Forward Differencing Method (using 'floats') with the following arguments:

    forward 1.0 0.1 10
    central 1.0 0.1 10
    Richardson 1.0 0.1 10
    

    You are to implement the Central Differencing Method and Richardson Extrapolation (just one level of divided differences).

    1. Run these 3 methods using both 'floats' and 'doubles'. Use the results to estimate the best 'h' value for these 6 methods (3 techniques x 2 floating point representations).
    2. Rerun these methods at value = 2.0 and again use both 'floats' and 'double'.

    Explain the results. Use the 'verbose' mode when appropriate to understand the results. Specifically, what do the results tell you about:

    1. the benefit in using smaller values of h in order to get a better approximation to the derivative of a function. At what value of h does the numerator value become totally round-off error?
    2. the benefit in using an approximation method with a better error term in order to get a better approximation to the derivative of a function.
    3. The tradeoff in using 'double' instead of 'float'.

SPECIFIC INSTRUCTIONS

On the due date, at the beginning of class, hand in hardcopy of

  1. the answers to the problems from the book
  2. your analysis of the results of the lab assignment, including output from the program when and where appropriate.

With respect to the lab assignment,


NOTES