Example (Newton interpolating polynomial)

Interpolate

$x_0=-2$

$x_1=-1$

$x_2 = 1$

$x_3 = 2$

$x_4 = 3$

$f(x_0) = 6$

$f(x_1) = -1$

$f(x_2) = 3$

$f(x_3) = -10$

$f(x_4) = -9$

Compute the divided differences

$f[x_0] = 6$

$f[x_0, x_1] = -7$

$f[x_1] = -1$

$f[x_0, x_1, x_2] = 3$

$f[x_1, x_2] = 2$

$f[x_0, x_1, x_2, x_3] = -2$

$f[x_2] = 3$

$f[x_1, x_2, x_3] = -5$

$f[x_0, x_1, x_2, x_3, x_4] = 1$

$f[x_2, x_3] = -13$

$f[x_1, x_2, x_3, x_4] = 3$

$f[x_3] = -10$

$f[x_2, x_3, x_4] = 7$

$f[x_3, x_4] = 1$

$f[x_4] = -9$

We evaluate the polynomial at a point $x$ with the Horner scheme $$ \begin{align*} p(x) = (((1\times (x-2)-2)\times(x-1)+3)\times (x+1)-7)\times (x+2) + 6. \end{align*} $$