Why the Form of a Polynomial Matters
A Taylor polynomial is often first written as a sum of powers of the displacement from its center. That form makes the coefficients and powers easy to identify, but it is not always the most efficient way to calculate a value. Rewriting the polynomial as a nested expression can reduce the number of multiplications required.
This matters whenever a polynomial is used as a computational approximation. The polynomial itself does not change: only the order in which its terms are evaluated changes. The number of arithmetic operations depends on the evaluation method, so comparisons should state which methods and operations are being counted.
From Taylor Form to Polynomial Coefficients
For a function \(f\), the Taylor polynomial of degree \(n\) centered at \(a\) is
For evaluation, it is convenient to set \(u=x-a\), the displacement from the center, and write the coefficients as \(c_k=f^{(k)}(a)/k!\). Then the same polynomial is
The coefficients are treated as already known. The task here is to evaluate this finite polynomial, not to estimate the error between it and the function it approximates. That approximation error is a separate question.
Horner’s Recurrence
Rather than forming each power of \(u\), Horner’s rule starts at the highest-degree coefficient and repeatedly multiplies by \(u\) and adds the next coefficient. Define the intermediate values by
The final value \(b_0\) is \(P(u)\). In practice, the recurrence is applied in descending index order, using the same \(u\) at each stage.
Set the current value equal to \(c_n\).
Multiply the current value by \(u\), then add the next coefficient.
After adding \(c_0\), the current value equals the polynomial evaluation.
Why the Nested Form Is Equal to the Original
The recurrence works because each intermediate value represents the part of the polynomial that remains after factoring out the powers already accounted for. More precisely, for every \(k\) from \(0\) to \(n\),
At \(k=n\), the sum contains only \(c_n\), so the statement holds because \(b_n=c_n\). Now suppose it holds for \(b_{k+1}\). The recurrence gives
This proves the stated formula at index \(k\), completing the backward argument. At \(k=0\), it says \(b_0=\sum_{j=0}^{n}c_j u^j=P(u)\). Thus Horner’s rule evaluates exactly the same polynomial as the original sum.
Worked Example: A Cubic Taylor Polynomial Centered at One
Worked Example: A Cubic Taylor Polynomial Centered at One
Evaluate \(T_3(x)=2-3(x-1)+4(x-1)^2+(x-1)^3\) at \(x=3\), first directly and then by Horner’s rule.
The displacement is \(u=x-1=3-1=2\). Direct evaluation gives
For Horner’s form, the coefficients in ascending powers of \(u\) are \(c_0=2\), \(c_1=-3\), \(c_2=4\), and \(c_3=1\). Nesting from the highest-degree coefficient down gives
Evaluate from the inside outward:
The results agree. Substituting \(u=2\) into the original polynomial also gives \(2-6+16+8=20\), checking the nested evaluation.
Operation Counts and Their Assumptions
To compare methods fairly, use this specific arithmetic model: count each scalar addition and multiplication as one operation; regard the coefficients as available; do not use fused multiply-add instructions; and do not exploit special coefficient values to skip operations. Both methods use the displacement \(u=x-a\), so its calculation is common to both and is excluded from the comparison.
For a dense degree-\(n\) polynomial, Horner’s recurrence has \(n\) stages after setting \(b_n=c_n\). Each stage uses one multiplication by \(u\) and one addition of a coefficient. Therefore it uses \(n\) multiplications and \(n\) additions.
For direct evaluation in the comparison used here, form \(u^2,\ldots,u^n\) sequentially. That takes \(n-1\) multiplications. Then multiply each of the \(n\) nonconstant terms by its coefficient, and add those terms to \(c_0\). This takes \(n\) more multiplications and \(n\) additions, for a total of \(2n-1\) multiplications and \(n\) additions.
| Method for a dense degree-\(n\) polynomial | Multiplications | Additions |
|---|---|---|
| Direct: sequential powers, then coefficient products | \(2n-1\) | \(n\) |
| Horner’s rule | \(n\) | \(n\) |
Consequently, for dense polynomials of degree at least two, Horner’s rule saves \(n-1\) multiplications under this model, with the same number of additions. At degree one, both methods use one multiplication and one addition: the counts are equal. Thus Horner’s rule does not increase the generic operation count in this comparison, but it does not reduce it for degree one. These counts describe the stated evaluation schemes; a different method of computing powers or special coefficients can change the comparison.
Worked Example: Evaluating an Exponential Taylor Polynomial
Worked Example: Evaluating an Exponential Taylor Polynomial
The degree-four Taylor polynomial for \(e^x\) centered at zero is \(T_4(x)=1+x+x^2/2+x^3/6+x^4/24\). Evaluate it at \(x=1/2\) by Horner’s rule and check the result by direct evaluation.
In descending coefficient order, the coefficients are \(1/24,\ 1/6,\ 1/2,\ 1,\ 1\). Horner’s form is
Set \(x=1/2\), then evaluate each stage:
For a direct check, the powers are \(x^2=1/4\), \(x^3=1/8\), and \(x^4=1/16\). Therefore
Both evaluations give \(211/128=1.6484375\). Under the stated generic count, Horner’s method uses four multiplications and four additions. Sequential direct evaluation uses three multiplications to form powers, four coefficient multiplications, and four additions: seven multiplications and four additions.
Worked Example: Degree One Has No Operation-Count Saving
Worked Example: Degree One Has No Operation-Count Saving
Evaluate \(P(x)=3+2(x-1)\) at \(x=4\), and compare the operation counts.
The displacement is \(u=4-1=3\). Direct evaluation gives
Horner’s form, with \(c_0=3\) and \(c_1=2\), is \(c_0+u c_1\). It gives
Both evaluations use one multiplication and one addition after \(u\) is known. Substitution into the original expression confirms \(3+2(4-1)=9\). This example shows why the claim that Horner’s rule always reduces the multiplication count would be too broad: for degree one, the generic counts are equal.
A Common Pitfall: Using the Wrong Input
For a Taylor polynomial centered at \(a\), the powers are powers of \(u=x-a\), not powers of \(x\). Forgetting the center changes the input to the polynomial and can produce a plausible-looking but incorrect calculation.
For the cubic in the first example, \(a=1\) and \(x=3\), so the required input is \(u=3-1=2\). If one mistakenly uses \(x=3\) directly, the calculation becomes
which is not the value of the Taylor polynomial at \(x=3\). The correction is to use the displacement \(u=2\), giving \(2-3(2)+4(2^2)+2^3=20\). The same displacement must be used at every Horner stage.
When Horner’s Rule Is Useful
Horner’s rule gives a systematic way to evaluate a polynomial while avoiding the separate formation of each power. It is especially useful when evaluating dense polynomials repeatedly, as can happen when Taylor polynomials serve as local computational models. The nested structure also gives a straightforward sequence of intermediate values to record and check.
The operation-count comparison does not by itself guarantee that every implementation produces identical rounded results on a computer. It establishes an exact algebraic identity and compares arithmetic counts under a stated model. The central practice is to preserve the same polynomial, use the correct displacement from its center, and evaluate coefficients in the correct order.
Check Your Understanding
Answer these questions using the definitions and comparison model in this tutorial.
- Write \(P(u)=5-2u+3u^2\) in Horner form.
- For a degree-\(n\) polynomial, how many multiplications and additions does Horner’s recurrence use under the stated model?
- Why are the generic multiplication counts equal for direct and Horner evaluation when \(n=1\)?
- If a Taylor polynomial is centered at \(a=2\) and evaluated at \(x=5\), what input should be used in its powers?
- For a dense degree-four polynomial, compare the multiplication counts of the two evaluation schemes used here.