One product shared by all the basis functions
Let distinct nodes \(x_0,\ldots,x_n\) carry data \(y_j\). The cardinal function \(\ell_j(x)\) is one at node \(j\) and zero at the other nodes. Its product formula is expensive if every evaluation repeats the same differences. Set \(w_j=1/\prod_{k\ne j}(x_j-x_k)\) and \(P(x)=\prod_k(x-x_k)\). Away from all nodes,
The polynomial interpolating constant data equal to one is one everywhere. Dividing the interpolating polynomial by this partition of unity cancels \(P(x)\) to give
At a node the written quotient divides infinities. Multiply numerator and denominator by \(x-x_j\) and take the limit to recover \(y_j\) exactly. An implementation should return the stored value when the evaluation coordinate equals a node. Multiplying every weight by the same nonzero factor leaves the quotient invariant, a useful freedom when storing weights.
Background · Barycentric weight
Only relative weights enter the rational expression for the interpolating polynomial. At a node return the recorded value directly.
Worked interpolation and data sensitivity
Take the nodes \(-1,0,1\). Their weights are proportional to \(1,-2,1\). With data \(1,0,1\) at \(x=0.5\), the numerator is \(2/3-2=-4/3\) and the denominator is
Hence \(p(0.5)=1/4\), as the polynomial \(x^2\) requires.
Change the middle datum from 0 to 0.01. Its cardinal function is \(1-x^2\), so the prediction at 0.5 rises by 0.0075. For arbitrary data perturbations bounded by \(\delta\), the triangle inequality gives
Large values of this sum signal a sensitivity of the interpolation problem. Evaluating the same polynomial by a smarter formula cannot remove this source of error.
Put more sensors near the endpoints
Approximate \(f(x)=1/(1+25x^2)\) on \([-1,1]\). Both curves use the same number of exact samples and the same barycentric algorithm. One uses equally spaced nodes and the other uses projections of equally spaced angles on a semicircle. Check the interior before inspecting the ends.
Tutorial on what the formula guarantees
Why do three weights with alternating signs produce an answer between zero and one in the first calculation? Must it always lie between the smallest and largest data?
Worked solution
The example reconstructs \(x^2\), which stays within that range on this interval. General cardinal functions may be negative. Unlike a convex combination, their weighted sum can overshoot the sampled range.
For the three nodes above, perturb only the datum at \(-1\) by 0.04. What is the change at \(x=0.5\)?
Worked solution
The left cardinal polynomial is \(x(x-1)/2\), equal to \(-1/8\) at \(0.5\). The change is \(-0.005\), with the opposite sign to the perturbation.
Read the university treatment
Compare the construction of weights with the theorem on the barycentric form. Reuse the same nodes to reproduce the data-perturbation calculation. Driscoll and Braun · Barycentric interpolation