The exact values of a unknown function are given:
interpolant: a function such that (the function we need to find)
Suppose of a polynomial vector space where is a subspace of with
The Monomial Basis (Vandermonde)
The most natural representation writes the polynomial as: Applying the interpolation conditions yields a linear system , where is the Vandermonde Matrix:
Solving this equation needs Theoretically elegant, but numerically toxic.
Newton-Basis
The Newton-Basis:
a basis from space A polynomial with degree can be expressed as
Calculation of the coefficients (divided differences)
Let

Suppose we store a 1D array of , then we can update with the formula
for k in range (1,n):
for i in range(n-1,k-1,-1):
y[i]=(y[i]-y[i-1])/(x[i]-x[i-k])In the end we have value in y[i]
or vectorized:
for k in range(1, n):
y[k:] = (y[k:] - y[k-1:-1]) / (x[k:] - x[:-k])