First post, by Jean Meeus
I have a problem when using QuickBASIC in DOSBOX.
Consider a polynomial of the 4th degree in x.
The coefficients are
a0 = 9.123
a1 = 0.21
a2 = 0.12
a3 = 0.06
a4 = 0.05
and the value is, say, 0.1.
The polynomial is written in the usual form y = a0 + a1*x + a2*x^2 + a3*x^3 + a4*x^4.
However, in order to avoid powers, I wrote the expression as Horner's formula:
y = x0 + x * (a1 + x*(a2 + x*(a3 + x*a4)))
Because all values are positive, and the values of a1 to a4, and x itself, are small quantities, the result must be a little larger than a0.
However, the result of the calculation is much smaller than a0, evidently an error.
What is the solution?
Jean Meeus