Calculating relative error in subtracting two approximate numbers

1k Views Asked by At

My numerical analysis textbook says:

Let $u=x_1+x_2$

Then, absolute error in $u$ is $\Delta u= \Delta x_1+ \Delta x_2$

Relative error in $u$ is $\frac{\Delta u}{u}=\frac{\Delta x_1+ \Delta x_2}{x_1+x_2}$

When $u=x_1 - x_2$, then absolute error $\Delta u$ is same as that in addition, i.e., $\Delta x_1+ \Delta x_2$. But while calculating relative error, separately $\frac{\Delta x_1}{x_1}$ and $\frac{\Delta x_2}{x_2}$ are calculated, and then relative error in $u$ is said to be $\frac{\Delta x_1}{x_1} - \frac{\Delta x_2}{x_2}$.

I cannot understand why the relative error in subtraction is not $\frac{\Delta u}{u} = \frac{\Delta x_1+ \Delta x_2}{x_1-x_2}$.

Please anyone help me clear this doubt. Thanks in advance.

1

There are 1 best solutions below

0
On

The result proposed in the textbook is just wrong. I would be very cautious about using a textbook containing such a basic mistake. The relative error in a subtraction is not the subtraction of the relative errors. Using Taylor's formula applied to $f(x,y)=x-y$ you get that, as a first order approximation,

$$ \frac{\Delta f}{f} \approx x \frac{f'_x(x,y)}{f(x,y)} \frac{\Delta x}{x} + y \frac{f'_y(x,y)}{f(x,y)} \frac{\Delta y}{y} = \frac{x}{x-y} \frac{\Delta x}{x} - \frac{y}{x-y} \frac{\Delta y}{y} $$

Here you can see the potential problem of large errors when subtracting two close quantities. This problem is known as "subtractive cancelling".