How this calculation works
Find a numerical minimax polynomial approximation using Remez exchange, with an explicit observed alternation diagnostic.
min over degree≤n polynomials maxx∈[a,b]|f(x)−p(x)|; n+2 alternating extrema characterize the exact optimum.A worked example
A degree3 approximation to exp(x) on[−1,1] has observed maximum absolute error approximately0.0055283701.
Good to know
Continuous real expression on an interval of width≤100, degree0–8, finite values within±1e8.2049-cell extrema search and local refinement; bounded exchange iteration. Numerical minimax candidate, not a formal global error certificate for arbitrary expressions.
Reference: Boost.Math: minimax approximation and Remez exchange (opens in a new tab) ↗
Minimizing the worst error
A minimax polynomial targets the largest absolute approximation error over an interval. It does not minimize the average squared error or merely interpolate selected observations. This makes the objective useful when a uniform bound matters more than exceptionally accurate behavior in just one part of the interval.
For continuous functions, the exact best degree-limited polynomial is characterized by alternating extrema of equal error magnitude. This calculator searches for that pattern numerically. Because arbitrary entered expressions can hide narrow features between samples, its result is explicitly a checked numerical candidate rather than a formal interval proof.
Compare this with the Chebyshev polynomial approximation calculator. Optimize worst-case approximation error with an equioscillation witness; a truncated Chebyshev expansion does not generally minimize that norm.
Function, interval and degree
Enter a real expression in x and an increasing closed interval. The declared model requires the function to be continuous throughout that interval and to remain inside the supported finite-value range. A pole or branch discontinuity cannot be made into a continuous approximation problem by choosing a high polynomial degree.
The interval is mapped to a normalized coordinate t between minus one and one. The polynomial is represented in a Chebyshev basis in that coordinate, improving conditioning compared with large raw powers of x. Keep that normalization when evaluating or exporting the reported coefficients.
A cubic approximation to the exponential
The default target is exp x on minus one to one, with degree three. The observed worst absolute error is approximately 0.0055283701. This differs from simply truncating the exponential's Taylor series at degree three, because the coefficients are adjusted to distribute error across the whole interval.
The output gives four Chebyshev coefficients and the refined error-extremum locations. Near convergence, their alternating magnitudes match the solved alternation amplitude. Checking several of those locations makes the defining worst-error objective visible rather than relying on one favorable example near the center.
The exchange step
A reference set of degree plus two argument locations supplies linear equations for the polynomial coefficients and one signed error amplitude. Solving this system enforces alternating errors at those locations. The residual function is then evaluated across the interval to find where the current polynomial actually performs worst.
Refined local extrema replace the reference locations, and the linear problem is solved again. Same-sign neighboring candidates are reduced to the stronger extremum so the reference set retains alternation. The process has a fixed iteration bound and rejects a case when enough reliable extrema cannot be isolated.
Reading the coefficient basis correctly
The first returned coefficient multiplies T0, the constant one. The second multiplies T1, equal to t, and later coefficients multiply the usual Chebyshev recurrence. These are not ascending monomial coefficients and should not be pasted into a polynomial evaluator expecting powers of the original x.
To evaluate, first compute t from the reported interval and then sum coefficient k times Tk of t. A numerically stable recurrence is preferable for higher degree. Forgetting the interval mapping can produce a completely different curve even when every coefficient was copied accurately.
Observed error and mathematical certification
The maximum observed error comes from a dense initial scan followed by local scalar refinement. The alternation amplitude comes from the linear reference equations. Close agreement between them is a strong diagnostic for ordinary smooth examples, and independent dense-grid linear programming provides a useful additional test.
Neither scan can prove that an arbitrary expression has no narrower missed extremum. Highly oscillatory functions, sharp boundary layers and poorly conditioned intervals require stronger adaptive or interval methods. The calculator states this limit instead of interpreting convergence of one exchange iteration as universal global certification.
Choosing the right approximation target
Compare absolute and relative objectives before using the coefficients. A small absolute error near a zero can still be a large relative error, while a large-magnitude target may need a scaled formulation. This page minimizes absolute error only and does not silently introduce relative weights.
Use the displayed residual extrema to assess whether another degree is worthwhile. For deployment in a numerical library, verify the candidate over the full intended domain with stronger precision and rounding analysis. A successful educational approximation is a starting point for that engineering process, not its final correctness proof.
A few questions, answered
Are coefficients powers of x?
No. They multiply Chebyshev polynomials in the interval-normalized variable t.
Does it minimize relative error?
No. The objective is the maximum absolute error over the supplied interval.
Is the displayed error a rigorous bound?
No. It is an observed refined maximum with an alternation check, not an interval certificate.
Why can a smooth-looking function be rejected?
The bounded exchange search may fail to isolate a stable alternating reference set or converge within its limits.