12.07.2015 Views

HW4 Solution

HW4 Solution

HW4 Solution

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(b) sin(x) − tan(x).We can use triangular formula when the cancelation occurs near x = kπ(k ∈ Z)sin(x) − tan(x) = sin(x) cos(x) − 1cos(x)2 sin 2 ( x= − sin(x) 2 )cos(x) .4. If at most 2 bits of precision can be lost in the computation of y = √ x 2 + 1 − 1,what restriction must be placed on x assuming computed as it is?<strong>Solution</strong>: Based on the Theorem, we have1 −1√x2 + 1 ≥ 1 2 2 .Hence, we can get|x| ≥⎧√ ⎪⎨ x2 + 1 − 1,x 2⎪⎩ √x2 + 1 + 1 ,√73 .if |x| ≥else.√73,14.1. True of False?(b) sin x = O(1) as x → 0.(c) log x = O(x 1100 ) as x → ∞.(f) fl(π) − π = O(ɛ machine ). (We do not mention that the limit is ɛ machine → 0, since thatis implicit for all expressions O(ɛ machine in this book.)(g) fl(nπ) − nπ = O(ɛ machine ), uniformly for all integers n. (Here nπ represents theexact mathematical quantity, not the result of a floating point calculation.)(b) True, because | sin(x)| ≤ 1 when x → 0.(c) True, because | log(x)/x 1/100 | → ∞ when x → 0.(f) True, because fl(π) can approximate π better when ɛ machine → 0.(g) False, because fl(nπ) − nπ = O(ɛ machine ) does not hold uniformly for alln ∈ Z.14.2. (a) Show that (1 + O(ɛ machine ))(1 + O(ɛ machine )) = 1 + O(ɛ machine ). Theprecise meaning of this statement is that if f is a function satisfying f(ɛ machine ) =(1 + O(ɛ machine ))(1 + O(ɛ machine )) as ɛ machine → 0, then f also satisfies f(ɛ machine ) =1 + O(ɛ machine ) as ɛ machine → 0.<strong>Solution</strong>:(1 + O(ɛ machine ))(1 + O(ɛ machine ))=1 + 2O(ɛ machine ) + O(ɛ machine )O(ɛ machine )=1 + O(ɛ machine ) + o(ɛ machine )=1 + O(ɛ machine )3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!