Interpolation & Function Approximation

the interpolation error formula

You fit a polynomial through some samples of a true function and then ask: between the dots, how far can my curve stray from reality? The interpolation error formula answers this. It tells you the gap between the function and its interpolant at any point, and crucially what makes that gap big or small.

If p is the degree-n polynomial interpolating a smooth function f at the n + 1 nodes x_0, ..., x_n, then for any x there is a point xi (somewhere in the smallest interval containing the nodes and x) such that f(x) - p(x) = f^(n+1)(xi) / (n+1)! times the node product (x - x_0)(x - x_1) ... (x - x_n). Read the three pieces: the (n+1)-th derivative of f measures how wiggly the true function is (a function with huge high derivatives is hard to interpolate); the factorial (n+1)! in the denominator helps, shrinking the error as you add points; and the node polynomial (x - x_0)...(x - x_n) measures your DISTANCE from the data — error is small near a cluster of nodes and large where x sits far from all of them, which is why interpolating outside the data range (extrapolation) is dangerous.

This single formula explains nearly everything about interpolation quality. It shows why error blows up near the ends of an equispaced grid (the node product is largest there) — the seed of Runge's phenomenon — and why CHOOSING the nodes to minimize the node product leads straight to Chebyshev nodes. The honest catch: the formula contains an unknown point xi and an unknown high derivative of f, so it is usually used to BOUND the error (replace f^(n+1)(xi) by its maximum), not to compute it exactly. And it assumes f is genuinely smooth — for a function with a kink or a nearby pole, adding more points need not help at all.

Interpolate f(x) = e^x at x = 0, 1 by the line p. The error at x is f''(xi)/2! times x(x-1) = e^xi/2 * x(x-1). On [0,1] the node product x(x-1) peaks (in size) at x = 0.5 with value -0.25, and e^xi is at most e, so |error| <= (e/2)(0.25) ~ 0.34 — and indeed the true gap there is about 0.21.

Error = high derivative over factorial, times distance-to-nodes.

Adding points does NOT always reduce error: it boosts (n+1)! in the denominator but can also blow up f^(n+1) and the node product. For equispaced nodes the latter two win near the ends, so the error can DIVERGE (Runge's phenomenon).

Also called
polynomial interpolation errorremainder term插值餘項插值誤差項