# numerical analisys close numbers question..

Printable View

• Mar 29th 2010, 08:52 AM
transgalactic
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?
• Mar 29th 2010, 11:11 AM
HallsofIvy
Quote:

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.
• Mar 29th 2010, 10:18 PM
transgalactic
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?
• Mar 30th 2010, 02:19 PM
awkward
Quote:

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!