Let $f(x)= \sqrt{x^2 + 1} - 1$ (taking the positive real square root, as usual). When $a = 10^{−3}$, compute $f(a)$, working to $5$ significant figures at every stage of the calculation.
Also it can be shown (algebraically) that
$$f(x) = \frac{x^{2}}{\sqrt{{x^2}+1}+1}.$$
Use this expression for $f$ to compute $f(a)$, again working to $5$ significant figures at every stage. Which calculation suffers from destructive cancellation?
After calculating I get that in the first case $f(a)=0.$ In the second case $f(a)=0.0000005.$