3

I got this problem from the book Numerical Analysis 8-th Edition (Burden):


Suppose two points $(x_0,y_0)$ and $(x_1,y_1)$ are on a straight line with $y_1\neq y_0$,

Two formulas are available to find the x-intercept of the line:

$x=\frac{x_0y_1-x_1y_0}{y_1-y_0}$ and $x=x_0-\frac{(x_1-x_0)y_0}{y_1-y_0}$

Explain why the second formula gives better results than the first formula when using rounding arithmetic.


I don't know for what reason the second formula gives better results than the first formula.

Thanks for any explanation.

MathNerd
  • 2,507

1 Answers1

2

One can think of this problem in the following way:-

Computational error generated in doing addition or subtraction is relatively small, but that generated by multiplication or division will be much larger.

In the first formula, there are three times of generating relatively larger computational errors ($x_0y_0$ is once). What about the second formula?

Mick
  • 17,141
  • Ok, I got it. Since in the first formula there are 2 times multiplication and 1 time division and in the second formula there are 1 time multiplication and 1 time division, we get that the second formula is better (despite that the total number of operations (addition, subtraction, multiplication, etc.) in both the first and the second formulas are the same (which is 5)). – MathNerd Jul 15 '15 at 14:14