CMSC/AMSC 460 Fall 2007: Round-off Error in Floating Point Arithmetic Homework 1 - Prof. D, Assignments of Mathematics

Information about the homework assignment for cmsc/amsc 460 fall 2007, due on september 18. The assignment focuses on understanding round-off error in floating point arithmetic, with specific examples given in the program hw1.m. Students are asked to determine if the computed sums equal the true values for various inputs, identify where errors occur, and suggest an ordering of numbers to add to minimize round-off error.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-r2i
koofers-user-r2i 🇺🇸

5

(1)

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CMSC/AMSC 460 Fall 2007
Homework 1
Due Tuesday, September 18, before class begins
10 points
Under fixed point arithmetic, if we add nnumbers, then either we get the
exact answer or we get an ”overflow” error.
Under floating point arithmetic, this is not true. We probably get an
approximation to the exact answer, although we could possibly get the exact
answer or overflow.
Consider the three examples in the program hw1.m. You might want
to play with the program, changing nor hor computing the difference be-
tween the computed sums and the true ones in order to understand what is
happening.
(a) (1) Is sum1 equal to the true value? If not, why not? (Be specific: it
is not enough to say, “Round-off caused the error.” If sum1 is not exact, in
what part of the calculation did the error arise?)
(b) (3) Are sum2 and sum3 equal to the true value? If not, why not?
And why aren’t they equal to each other?
(c) (3) Are sum4 and sum5 equal to the true value? If not, why not? And
why aren’t they equal to each other?
(d) (3) Given nnumbers to add, what ordering do you advise using to
keep round-off error small?
1

Partial preview of the text

Download CMSC/AMSC 460 Fall 2007: Round-off Error in Floating Point Arithmetic Homework 1 - Prof. D and more Assignments Mathematics in PDF only on Docsity!

CMSC/AMSC 460 Fall 2007 Homework 1 Due Tuesday, September 18, before class begins 10 points

Under fixed point arithmetic, if we add n numbers, then either we get the exact answer or we get an ”overflow” error.

Under floating point arithmetic, this is not true. We probably get an approximation to the exact answer, although we could possibly get the exact answer or overflow.

Consider the three examples in the program hw1.m. You might want to play with the program, changing n or h or computing the difference be- tween the computed sums and the true ones in order to understand what is happening.

(a) (1) Is sum1 equal to the true value? If not, why not? (Be specific: it is not enough to say, “Round-off caused the error.” If sum1 is not exact, in what part of the calculation did the error arise?)

(b) (3) Are sum2 and sum3 equal to the true value? If not, why not? And why aren’t they equal to each other?

(c) (3) Are sum4 and sum5 equal to the true value? If not, why not? And why aren’t they equal to each other?

(d) (3) Given n numbers to add, what ordering do you advise using to keep round-off error small?