CS335 Study Guide - Final Guide: Round-Off Error, Double-Precision Floating-Point Format, Byrsonima Crassifolia

158 views6 pages

Document Summary

Example: if is positive oating-point number slightly smaller than m, then (1+ ) (1 ) = Note: the problem of adding two fp numbers is ill-conditioned when x y (showed in class). We want to evaluate exp(x), when x = 5. 5 by computing an approximation to exp(x): two methods, method 1: exp( 5. 5) = 1 5. 5 + 5. 52. We are adding and subtracting numbers which are large compared to the nal results. + 5. 53: method 2: exp( 5. 5) = 1 e5. 5 = 0 xn x + dx, = const. It can be shown that p is well-conditioned. 1 x + dx = logh 1 + . 0 xn + xn 1 x + dx = z 1. We can use this to evaluate in recursively. (for a general n, in is not easy to compute analytically. ) Algorithm 1 recursive algorithm to compute in for a xed .