Department of Computer Science and Technology

Numerical Methods Supervision 1

Exercises

Questions beginning with S are from the course workbook. Your answers to non-exam questions should be reasonably short: one or two paragraphs each.

  1. S1.4
    Give the code for base/radix 4 multiplication without Booth’s optimisation. This will need to multiply by 3 on occasion.

  2. 2006 Paper 3 Question 6, all except part e)

  3. S1.9
    Given that most computer languages today support 32-bit signed integers and double-precision floating point, can it be argued that having the integers is silly since they are a subset of the doubles?

  4. S1.10
    Sketch a proof that the bit patterns of unsigned floating point numbers can be passed directly to an integer comparison routine, and the correct result will be produced. Mention any exceptions.

  5. S1.14
    Sketch a program to determine the value of machine epsilon experimentally.

  6. S1.15
    F1 = (3.4522 * 11.233) + 13.966
    F2 = (3.4522 - 3.4166) / 17.822
    1. Round the numbers in F1 and F2 to three significant figures. Compute the exact results of the expressions before and after rounding.
    2. Assume we did only know the numbers in their rounded form (so did not know the accurate versions). Work out the relative and absolute error bounds for the two expressions using the lectured rules (abs. errors sum for add and sub, rel. errors sum for times and divide). Compare the errors predicted by the rules with the actual errors if you work to 3sf throughout.
    3. What difference does it make if you do not truncate and round to 3sf after each step but only at the end?
    4. What is the expected (mean) value of the initial quantisation errors and final result assuming fair rounding is used?

  7. 2005 Paper 4 Question 7

  8. There exists a trigonometric identity: 1 - cos(x) = 2sin2(x/2). Which of these expressions is likely to give more accurate results for small x and why? After you have answered, you can check your intuition using Wolfram|Alpha. Comment on the features you see in this plot.