Mathematical Principles for Scientific Computing and Visualization  
http://www.farinhansford.com/books/scv
by Gerald Farin and Dianne Hansford

This notebook demonstrates stability problems with high degree polynomial interplolation.
Changing one data value just a bit can cause the interpolant's behavior to change significantly.
See "eps" below. The first cell allows you to change eps manually; the second cell is an animated version


See Chapter 2: Computational Basics for details.

Updated May 2008

(* Create a set of 20 data points (x,y) where x ranges from -1 to 1 *)

vals=Table[{-1+i/10,Sqrt[1.0-(1-i/10.)^2]},{i,0,20}]//N;

(* Change one value by just a bit -- just 0.001 changes the interpolant! *)
(* Let eps range from 0 to 0.01 *)
eps = 0.00005;
vals[[10,2]]=vals[[10,2]]+eps;


plotpts = Graphics[{PointSize[0.03],Point[vals]}];
plotspecial = Graphics[{PointSize[0.03], Red, Point[vals[[10]]]}];

(* Construct the interpolating polynomial to the input function values *)
p[x_]=InterpolatingPolynomial[vals,x];

(* Plot the polynomial over -1,1 *)

plotpoly = Plot[p[x],{x,-1,1}, PlotStyle->Thickness[0.01]];

Show[plotpts, plotpoly, plotspecial, Axes->True]

Here is a version with the Manipulate function.

Clear[vals];

(* Create a set of 20 data points (x,y) where x ranges from -1 to 1 *)

vals=Table[{-1+i/10,Sqrt[1.0-(1-i/10.)^2]},{i,0,20}]//N;

originalval = vals[[10,2]];

(* Modify one data value and regenerate the point plot *)

modifyptplot[eps_] :=  ( vals[[10,2]]=originalval+eps;Return[Graphics[{PointSize[0.03], Red, Point[vals[[10]]]}]];)

(* REgeneterate the polynomial interpolant and plot of the function *)

modifyplotpoly[eps_] := (p[x_]=InterpolatingPolynomial[vals,x];Return[Plot[p[x],{x,-1,1}, PlotStyle->Thickness[0.01]]];)


Manipulate[Show[plotpts, modifyptplot[eps], modifyplotpoly[eps], Axes->True, PlotRange->{{-1.2, 1.2}, { -0.5, 2.0}}], {{eps, 0.0},-0.01,0.01, 0.00005}]