Suppose $f(x) = \sqrt{x^2+1}-x$ is to be computed in 4-digit rounding arithmetic. (i) Determine the value of $f(42.545)$ in 4-digit rounding arithmetic, and the relative error of this value.
Notation: $fl(a)$ means 4-digit rounding of the value $a$.
$x=42.545 \implies fl(x)=0.4255x10^2$
$fl(x) \times fl(x)=1810.5025=0.18105025 \times 10^4$
$fl[fl(x)\times fl(x)]=0.1811\times 10^4$
$fl[fl(x)\times fl(x)]+1=0.1812\times 10^4$
let $a=\sqrt{fl[fl(x)\times fl(x)]+1}=42.56759331$
$fl(a)=0.4257x10^2$
$fl(a) - x=0.02$
Now the exactly value is 0.01175, so i assume there has to be an instance or instances of catastrophic cancellation somewhere in the computation (did i even do that right?) but i can't seem to find it.
Furthermore, is there another method to calculate this to minimise the error?