Polynomial Evaluation Calculator
Evaluate any polynomial at a given x.
Formula
Horner's method
Example
Coeffs 1,-3,2 at x=5: x²-3x+2 = 12.
Embed this calculator on your site
Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.
<iframe src="https://calcnestai.com/embed/polynomial-evaluation-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Polynomial Evaluation Calculator — Free Tool by CalcNest AI"></iframe>
Understanding the Polynomial Evaluation Calculator
A polynomial evaluator computes the value of a polynomial at a given input from its coefficients. How that evaluation is performed matters more than it appears, because the obvious method is both slower and less accurate than a rearrangement known for centuries.
How it actually works
Enter coefficients from the highest power down, separated by commas, and a value for x. The calculator multiplies each coefficient by the appropriate power and sums. Coefficients 1, −3, 2 evaluated at 5 give 12.
| Method | Multiplications |
|---|---|
| Naive powers | About n²/2 |
| Precomputed powers | 2n |
| Horner's method | n |
| Accuracy | Horner is also more stable |
The deeper context most people miss
Horner's method rewrites the polynomial as nested multiplications, so evaluating a degree n polynomial takes n multiplications and n additions rather than computing each power separately. It is optimal in the number of operations and is also numerically better behaved.
How Horner's method works and why it is optimal
The rearrangement is simple once seen: instead of computing ax³ plus bx² plus cx plus d directly, write it as ((ax + b)x + c)x + d. Each step multiplies the running total by x and adds the next coefficient, so a degree n polynomial needs exactly n multiplications and n additions. The naive approach computing each power independently requires far more, and even precomputing powers takes roughly twice as many multiplications. Horner's method is provably optimal in multiplications for general polynomial evaluation, a result established by Ostrowski and Pan, so no rearrangement does better without additional structure. The numerical advantage is separate and equally valuable: computing large powers separately produces intermediate values of widely varying magnitude that must then be summed, and summing terms of very different sizes loses precision through rounding, while Horner's method keeps intermediate values on a comparable scale. For polynomials with alternating signs and large coefficients, the difference between methods can be substantial. The method is named for William Horner who published it in 1819, and it appears in Chinese mathematics centuries earlier in the work of Qin Jiushao, and possibly earlier still, which is a common pattern in the attribution of mathematical techniques.
A worked example: what polynomials are for
Coefficients 1, −3, 2 describe x squared minus 3x plus 2, which evaluates to 12 at x equals 5 and factors as (x−1)(x−2), so its roots are 1 and 2. Polynomials matter far beyond algebra exercises because they are the functions computers can evaluate directly, using only multiplication and addition, which makes them the basis for approximating everything else. Taylor series approximate any smooth function by a polynomial near a point, and truncating one gives the practical approximations used throughout numerical work, including the small angle approximation for sine. Chebyshev polynomials give better approximations over an interval than Taylor series do, minimising the maximum error rather than the error at a single point, which is why they underlie the implementations of trigonometric and exponential functions in mathematical libraries. Spline interpolation fits piecewise polynomials through data points and is used in graphics, animation, and data smoothing, with cubic splines being the common choice because they are smooth enough to look right without the oscillation that high-degree single polynomials suffer. That oscillation, Runge's phenomenon, is why fitting a single high-degree polynomial through many points is a poor idea despite passing through every one of them: it swings wildly between them, which is a clean illustration of why interpolating exactly is not the same as approximating well.
Deciding how to work with polynomials computationally
Several practical concerns recur. Use Horner's method for evaluation, which most library routines do. Beware of high degrees, since polynomials of degree beyond about ten become numerically fragile, with coefficients spanning many orders of magnitude and small perturbations producing large changes in the roots. Wilkinson's polynomial is the standard demonstration: a degree twenty polynomial with roots at the integers one to twenty has roots that move enormously under a tiny change to one coefficient, which showed that root-finding can be catastrophically ill-conditioned even for a well-behaved-looking problem. For fitting, prefer low-degree polynomials or splines to high-degree ones, since a high-degree fit interpolates noise and oscillates between data points. For root finding, use library routines that work from the companion matrix eigenvalues or use specialised algorithms, rather than iterating a general method from arbitrary starting points. Represent polynomials in a stable basis where possible, since the monomial basis is poorly conditioned and Chebyshev or Bernstein bases behave far better, which is why Bézier curves in graphics use the Bernstein basis. And for symbolic work, computer algebra systems handle exact coefficient arithmetic and avoid the numerical issues entirely at the cost of speed.
Why polynomials underlie so much computation
A polynomial is fully determined by its coefficients, which makes it a finite object representing a function, and this representability is why they appear throughout computing. Error-correcting codes including Reed-Solomon treat data as polynomial coefficients and exploit the fact that a degree n polynomial is determined by n plus one points, so evaluating at extra points adds redundancy allowing recovery from errors, which is what makes CDs, QR codes, and deep-space communication robust. Cyclic redundancy checks perform polynomial division over a finite field. Secret sharing schemes use the same property: a secret is the constant term of a polynomial, shares are evaluations at distinct points, and any sufficient subset reconstructs it while fewer reveal nothing, which is Shamir's scheme. Cryptographic commitments and zero-knowledge proof systems use polynomial identities extensively, with recent proof systems resting on the difficulty of satisfying polynomial equations without knowing the underlying data. The fast Fourier transform can be understood as fast polynomial multiplication by evaluating at roots of unity, multiplying pointwise, and interpolating back, which reduces the cost from quadratic to n log n and underlies a large share of signal processing. In each case the useful property is that polynomials are simultaneously algebraic objects and evaluable functions, so structure in one view translates into the other.
Variations: representations, operations, and special families
The monomial basis lists coefficients of powers and is the familiar form, and it is numerically poorly conditioned for high degrees. The Chebyshev basis is far better conditioned for approximation over an interval. The Bernstein basis underlies Bézier curves and has useful geometric properties including the convex hull property. The Lagrange form interpolates through given points directly. Newton's divided difference form allows incremental addition of points. Operations include addition, multiplication, division with remainder, differentiation, and integration, all of which are straightforward on coefficients, with multiplication being convolution of coefficient sequences, which is precisely why fast convolution via the Fourier transform accelerates it. Roots relate to coefficients through Vieta's formulas. Special families include Chebyshev, Legendre, Hermite, and Laguerre polynomials, each orthogonal with respect to a different weight and each arising naturally in a different physical or approximation context. Orthogonal polynomials underlie Gaussian quadrature, where the optimal evaluation points are the roots of the relevant family, which is why that method achieves such high accuracy for its number of function evaluations.
Evaluating and using polynomials well
Use Horner's method rather than computing powers separately, which halves or better the multiplications and is numerically more stable because intermediate values stay on a comparable scale. Keep degrees low, since polynomials beyond about degree ten become numerically fragile with coefficients spanning many orders of magnitude. Prefer splines to high-degree polynomial fits, since a single high-degree polynomial passing through every data point oscillates wildly between them, which is Runge's phenomenon. Use a well-conditioned basis such as Chebyshev or Bernstein for approximation and geometry rather than raw monomials. Expect root finding to be ill-conditioned for high degrees, since Wilkinson's polynomial shows roots moving enormously under tiny coefficient changes. Use library root-finding routines rather than hand-rolled iteration. Remember that polynomial multiplication is convolution of coefficients, which is why the fast Fourier transform accelerates it. And use exact arithmetic in symbolic systems where coefficients are rational and precision matters more than speed.
What people get wrong
- Evaluating by computing each power separately, which takes roughly twice the multiplications of Horner's method and loses precision by summing terms of very different magnitudes.
- Fitting a high-degree polynomial through many data points, which interpolates every point and oscillates wildly between them, a failure known as Runge's phenomenon.
- Assuming polynomial roots are stable, when Wilkinson's polynomial demonstrates that a tiny change to one coefficient can move roots enormously even for a well-behaved-looking problem.
- Using the monomial basis for high-degree approximation, when Chebyshev and Bernstein bases are far better conditioned and produce dramatically more reliable results.
Where the math comes from
A polynomial with coefficients aₙ down to a₀ evaluates as aₙxⁿ + … + a₁x + a₀. Horner's method rewrites this as (…((aₙx + aₙ₋₁)x + aₙ₋₂)x + …) + a₀, requiring exactly n multiplications and n additions, which is provably optimal and also numerically more stable since intermediate values remain on a comparable scale.
Questions and answers
How do I check my answer?
Plug the answer back into the original equation. If both sides match, the answer is correct. This works for any algebraic problem.
Can the calculator handle complex roots?
Most basic calculators handle real roots only. Complex roots (when discriminant is negative for quadratics) require a complex-number-aware calculator.
What if the equation has no solution?
Some equations have no real solutions. The calculator should indicate this rather than returning nonsense. If it does not, try simplifying the equation first.
How do I solve systems of equations?
Substitution, elimination, or matrix methods. Two-equation, two-unknown systems are simplest; larger systems need matrix calculators.
Is there one method that always works?
For polynomials up to degree 4, yes - the quadratic, cubic, and quartic formulas. Degree 5+ generally requires numerical methods. For most real-world problems, factoring, formula, or graphing handles everything.
What is Horner's method?
A rearrangement evaluating a polynomial as nested multiplications, so each step multiplies a running total by x and adds the next coefficient. It needs n multiplications for degree n, which is provably optimal, and it's numerically more stable than computing powers separately.
Why is computing powers separately worse?
It takes roughly twice the multiplications, and it produces intermediate values of widely varying magnitude that must then be summed, which loses precision through rounding. Horner's method keeps intermediates on a comparable scale.
Why not fit a high-degree polynomial to my data?
Because it will pass through every point and oscillate wildly between them, a failure called Runge's phenomenon. Interpolating exactly is not the same as approximating well, and splines or low-degree fits behave far better.
Are polynomial roots stable?
Frequently not. Wilkinson's polynomial, with roots at the integers one to twenty, has roots that move enormously under a minute change to a single coefficient. Root finding can be catastrophically ill-conditioned even when the polynomial looks well behaved.
Why do polynomials appear in error correction?
Because a degree n polynomial is fully determined by n plus one points, so evaluating at extra points adds redundancy that allows recovering from errors. Reed-Solomon codes use this, which is what makes CDs, QR codes, and deep-space communication robust.
What basis should I use?
Chebyshev for approximation over an interval and Bernstein for geometry and curves, both of which are far better conditioned than the raw monomial basis. Bézier curves use Bernstein specifically because of its geometric and numerical properties.
How does the Fourier transform relate to polynomials?
Polynomial multiplication is convolution of coefficients, and the fast Fourier transform computes convolution efficiently by evaluating at roots of unity, multiplying pointwise, and interpolating back. That reduces the cost from quadratic to n log n.
Related calculators
Factorial · Quadratic Equation · Matrix Addition · Greatest Common Factor · Absolute Value Equation