 he298c

2020-12-29

a) Use base b = 10, precision k = 4, idealized, chopping floating-point arithmetic to show that fl(g(1.015)) is inaccurate, where $g\left(x\right)=\frac{{x}^{\frac{1}{4}}-1}{x-1}$ b) Derive the second order (n = 2) quadratic Taylor polynomial approximation for $f\left(x\right)={x}^{\frac{1}{4}}$ expanded about a = 1, and use it to get an accurate approximation to g(x) in part (a). c) Verify that your approximation in (b) is more accurate. avortarF

(a) Compute g(x) for $x=1.015.$

$g\left(1.015\right)=\frac{\left(1.015\right)1/4-1}{1.015-1}=0.248605929$

This is the exact value of g(x). In the ideal situation of chopping floating-point arithmetic, the operations are performed one at a time and the results are chopped after each operation. The floating-point number of the result with precision $k=4$ is $fl\left(g\left(1.015\right)\right)=\frac{fl\left(\left(1.015{\right)}^{1/4}\right)-1}{fl\left(1.015-1\right)}$

$=\frac{1.004-1}{0.015}$

$=\frac{fl\left(1.004-1\right)}{0.015}$

$=fl\left(\frac{0.004}{0.015}\right)$

$=0.2667$

The absolute value of $g\left(x\right)$ is 0.248605929 and the floating-point value is 0.2667. The machine precision for $b=10$ and $k=4$ is ${\in }_{mach}=\frac{1}{2}{b}^{1-k}=\frac{1}{2}{10}^{1-4}=5×{10}^{-4}$ The absolute error is $\frac{|fl\left(g\left(1.015\right)\right)-g\left(1.015\right)|}{|g\left(1.015\right)|}=\frac{|0.2667-0.248605929|}{|0.248605929|}\approx 0.073\approx 7.3\mathrm{%}>5×{10}^{-4}$ Hence, $fl\left(g\left(1.015\right)\right)$ is inaccurate. (b) The Taylor's polynomial of order 2 of a function f(x) around a point x = a is $f\left(x\right)=f\left(a\right)+{f}^{\prime }\left(a\right)\left(x-a\right)+\frac{f{}^{″}\left(a\right)}{2!}{\left(x-a\right)}^{2}$ Given $f\left(x\right)={x}^{1/4}$  $⇒{f}^{\prime }\left(x\right)=\frac{1}{4{x}^{3/4}}$ and ${f}^{\prime }\left(x\right)=-\frac{3}{16{x}^{\frac{7}{4}}}$ We shall take an expansion around the point x = 1. After substituting and simplifying, we get the Taylor's quadratic polynomial as follows: $f\left(x\right)={x}^{\frac{1}{4}}=1+\frac{1}{4}\left(x-1\right)-\frac{3}{32}{\left(x-1\right)}^{2}$ Now, approximate g(x) by using the Taylor`s polynomial f(x). $fl\left(g\left(x\right)\right)=fl\left(\frac{f\left(x\right)-1}{x-1}\right)$

$=fl\left(\frac{1+\frac{1}{4}\left(x-1\right)-\frac{3}{32}\left(x-1{\right)}^{2}-1}{x-1}\right)$

$=fl\left(\frac{\frac{1}{4}\left(x-1\right)-\frac{3}{32}\left(x-1{\right)}^{2}}{x-1}\right)$

Substitute values and use idealized, chopping floating-point arithmetic. Jeffrey Jordon