hw2_solutions - Numerical Methods Homework 2 CS257 All...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Numerical Methods - Homework 2 CS257 September 13, 2006 All computer problems are worth 2 points. All remaining problems are worth 1 point. 1. Solution 2.2 14: The exact sum of these four numbers is 0.31491. We will use this to calculate relative error. Next, we add the numbers in ascending order and computer the error fl(0 . 00051 + 0 . 0034) = 0 . 0039 fl(0 . 0039 + 0 . 061) = 0 . 065 fl(0 . 065 + 0 . 25) = 0 . 32 err = | . 32- . 31491 | . 31491 ≈ 1 . 62 × 10- 2 Finally, we compute the sum by adding the numbers in reverse order and compute the error in this case fl(0 . 25 + 0 . 061) = 0 . 31 fl(0 . 31 + 0 . 0034) = 0 . 31 fl(0 . 31 + 0 . 00051) = 0 . 31 err = | . 31- . 31491 | . 31491 ≈ 1 . 56 × 10- 2 Adding the numbers in reverse order gives better results. 2. Solution 2.2 25: Following the hint in the book, we note that xy is computed as fl(fl( x ) fl( y )). z = fl(fl( x ) fl( y )) = (1 + δ 3 )((1 + δ 1 ) x )((1 + δ 2 ) y )) ≈ (1 + δ 1 + δ 2 + δ 3 ) xy Assuming that neither x nor y is zero allows us to read off the relative error as | δ 1...
View Full Document

This note was uploaded on 09/15/2008 for the course CS 257 taught by Professor Thomaskerkhoven during the Fall '05 term at University of Illinois at Urbana–Champaign.

Page1 / 6

hw2_solutions - Numerical Methods Homework 2 CS257 All...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online