# Thread: numerical analisys close numbers question..

1. ## numerical analisys close numbers question..

$y=\sqrt{x^2+1}-1$
how do we know that there is a subtraction of two close numbers thus making loss of significance?
there is no close numbers there is variable X
it could give use a close result or otherwise

and why multiplying and dividing by $y=\sqrt{x^2+1}+1$
makes it go away?

2. Originally Posted by transgalactic
$y=\sqrt{x^2+1}-1$
how do we know that there is a subtraction of two close numbers thus making loss of significance?
there is no close numbers there is variable X
it could give use a close result or otherwise

and why multiplying and dividing by $y=\sqrt{x^2+1}+1$
makes it go away?
I presume this means for x close to 0. For example, if x= 0.001, $\sqrt{x^2+ 1}- 1= \sqrt{1.000001}- 1= 1.0000004999998750000624999609375- 1$ $= 0.0000004999998750000624999609375$. If you are rounding to, say, 6 decimal places, That would be just 0. As for multiplying and dividing by $\sqrt{x^2+ 1}+ 1$ the result, of course, will be the same but I presume that this is talking about it being some intermediate result in a further calculation- where the " $x^2$" you would get in the numerator will be canceled.

3. we get x^2 in the nominator
and a sum in the denominator
now there is some stuff about relative error
but i dont know what?

4. Originally Posted by transgalactic
$y=\sqrt{x^2+1}-1$
how do we know that there is a subtraction of two close numbers thus making loss of significance?
there is no close numbers there is variable X
it could give use a close result or otherwise

and why multiplying and dividing by $y=\sqrt{x^2+1}+1$
makes it go away?
I think you have already figured out that
$y=\frac{x^2}{\sqrt{x^2+1}+1}$

The point of the exercise is that in this form the value can be computed without the catastrophic loss of significant figures that occurs in the original computation when x is small due to the subtraction of two almost-equal numbers.

Or, to put it another way, No Subtraction!