[Math] Horner’s Polynomial Evaluation for a postive and negative x

computational complexitypolynomials

Solving a polynomial with value $x$ using Horner's method seems to use the least amount of multiplications and additions, 1 of each per pass. How would you use this with $\pm x$ using only $n + 1$ multiplications and additions?

So $7x^5-3x^3 + 2x^2 +x -5$ would give $13$ multiplications and $4$ additions, total of 17 operations.

With Horner's it would be $(((((7x + 0)x – 3)x + 2)x + 1)x – 5)$ would give $5$ multiplications and additions for a total of 10 operations.

Just using Horner's twice, once for $x$ and once for $-x$ would give you $2n$ multiplications and additions. I know you could cut down the number of operations because the even powers give the same answers whether a negative or positive is in it. But that isn't near enough. Is there a relation to the final answers? I can't find any other similarities when writing out each.

I have looked almost everywhere to find a start, so if someone could point me in the right direction it would be much appreciated.

Best Answer

Split your polynomial into odd and even parts.

The even part is $$f_E(x) = a_0 + a_2x^2 + a_4x^4 + \cdots$$ which you can consider a polynomial in $x^2$ and evaluate by $n/2$ steps of Horner's method.

The odd part is $$ f_O(x) = a_1x + a_3x^3+a_5x^5 + \cdots = x(a_1+a_3x^2 + a_5x^4+\cdots) $$ where the bracket on the right is again a polynomial in $x^2$ that you can evaluate in $n/2$ steps. Thereafter it takes only a single multiplication to multiply by $x$.

Now $f(x)=f_E(x)+f_O(x)$ and $f(-x)=f_E(x)-f_O(x)$.

The total additional work compared to evaluating just $f(x)$ directly is one multiplication to create $x^2$, one multiplication to get the single $x$ factor in $f_O$, and one addition and subtraction to combine everything at the end -- no matter what the degree.

Related Question