next up previous
Next: About this document ...

ESC 251 HW 3 Due: Sep 6

1)
a)
(2 pts) Compute the relative error in the expression 1-x4 when x=1.01. Use 3 digit, rounded arithmetic.
b)
(2 pts) Repeat a) using the equivalent expression (1-x2)(1+x2). Which expression is more accurate?
c)
(2 pts) Modify the expression in b) to obtain an expression that is even more accurate. Compute the resulting relative error.
NOTE: Be careful about how you compute x4.
2)
Each of the expressions below will suffer from catastrophic cancellation error for the given ranges of x. Rewrite the expressions so that catastrophic cancellation does not occur.
a)
(1 pt) $\ln(x+1) - \ln(x)$ for x large
b)
(2 pt) $\displaystyle{\frac{1-\cos(x)}{x^2}}$ for $x \approx 0.$
c)
(2 pt) $\displaystyle{\sqrt[3]{1+x}-1}$ for $x \approx 0.$ (HINT: Use the difference of 2 cubes).




2017-09-01