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.$
You have just seen an example of destructive cancellation. If you have $1.0001$ and $1.0000$, these are both five digit numbers. The maximum relative error is about $5E-6$. If you subtract them, you get $0.0001$, which is a single digit number. This happens whenever you subtract two imprecise numbers that are close to each other. Look at the two calculations you did and see where this happens.