20105ee103_1_hw9_sols

20105ee103_1_hw9_sols - L. Vandenberghe 12/3/10 EE103...

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: L. Vandenberghe 12/3/10 EE103 Solutions for problems from chapter 16 1. Exercise 16.1. We can rewrite the formula as 1- cos x sin x = (1- cos x )(1 + cos x ) sin x (1 + cos x ) = sin x 1 + cos x . Evaluating this expression yields >> format long e >> chop(sin(1e-2), 4) / (1 + chop(cos(1e-2), 4)) ans = 5.000000000000000e-003 which is much more accurate, if we compare with the result in the full Matlab precision >> format long e >> (sin(1e-2)) / (1+cos(1e-2)) ans = 5.000041667083338-003 2. Exercise 16.4. Expressions (16.6) and (16.8) suffer from cancellation; expression (16.7) does not. Cancellation occurs when two numbers are subtracted that are almost equal, and one or both are subject to error. Therefore cancellation occurs in the subtraction in (16.6) and (16.8). In (16.7) we also subtract two almost equal numbers a and b , but they are not subject to error (under the assumptions of the problem). 3. Exercise 16.5. Matlab returns the following numbers (a) 0 (b) 1 . 1102 10- 16 (c)- 1 . 1102 10- 16 (d) 0 (e)- 2 . 2204 10- 16 (f) 4 . 4409 10- 16 (g)- 2 . 2204 10- 16 1 To explain the first three values, we have to determine the floating-point numbers...
View Full Document

Page1 / 5

20105ee103_1_hw9_sols - L. Vandenberghe 12/3/10 EE103...

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