Math
Interpolation and Runge's phenomenon
Compare polynomial and cubic-spline interpolation, expose Runge’s phenomenon and measure the effect of Chebyshev nodes.

Try this
Increase the node count to expose Runge oscillations near the ends. Compare barycentric polynomial interpolation and a natural cubic spline. Errors are sampled at 2001 points; the plot clips extreme overshoot to keep the function readable.
Equations used in the module
Equations p(x) = [Σ wᵢ yᵢ/(x−xᵢ)] / [Σ wᵢ/(x−xᵢ)] wᵢ = 1 / ∏ⱼ≠ᵢ(xᵢ−xⱼ) Chebyshev–Lobatto: xᵢ = −cos(πi/(n−1)) Natural cubic spline: continuous first and second derivatives; s″(−1)=s″(1)=0


