Tea Time Numerical Analysis · Problem 1.1.24

Preliminaries — Leon Brin

Mathematics — Numerical Analysis · algorithmic-roundoff-error

Problem

Calculate (i) p~∗\tilde{p}^* using a calculator or computer, (ii) the absolute error, ∣p~∗−p∣|\tilde{p}^* - p|, and (iii) the relative error, ∣p~∗−p∣∣p∣\frac{|\tilde{p}^*-p|}{|p|}. Then use the given value of p~\tilde{p} to compute (iv) the algorithmic error, ∣p~−p∣|\tilde{p}-p| and (v) the round-off error, ∣p~∗−p~∣|\tilde{p}^* - \tilde{p}|. ((a)) Let f(x)=x4+7x3−63x2−295x+350f(x) = x^4+7x^3-63x^2-295x+350 and let p=f′(−2)p = f'(-2). The value p~=f(−2+10−7)−f(−2−10−7)2(10)−7\tilde{p} = \dfrac{f(-2+10^{-7})-f(-2-10^{-7})}{2(10)^{-7}} is a good approximation of pp. p~\tilde{p} is exactly 8.999999999999998.99999999999999. ((b)) Let f′(x)=exsin⁡(10x)f'(x) = e^x \sin(10x) and f(0)=0f(0) = 0 and let p=f(1)p = f(1). It can be shown that p=1101e(sin⁡10−10cos⁡10)+10101p = \frac{1}{101}e(\sin 10 - 10\cos 10) + \frac{10}{101}. Euler's method produces the approximation p~=110∑i=110ei/10sin⁡i\tilde{p} = \frac{1}{10}\sum_{i=1}^{10} e^{i/10}\sin i. Accurate to 28 significant digits, p~\tilde{p} is 0.20716470181592414994107985690.2071647018159241499410798569. ((c)) Let a0=5+58a_0 = \frac{5+\sqrt{5}}{8} and an+1=4an(1−an)a_{n+1} = 4a_n(1-a_n), and consider p=a51p = a_{51}. It can be shown that p=a51=5−58p = a_{51} = \frac{5-\sqrt{5}}{8}. The most direct algorithm for calculating a51a_{51} is to calculate a1,a2,a3,…a51a_1, a_2, a_3, \ldots a_{51} in succession, according to the given recursion relation. Use this algorithm to compute p~∗\tilde{p}^* and p~\tilde{p}.

Related theory

Browse the problem library