Algorithm for the Newton Form of the Interpolating Polynomial
Given the Lagrange form or the Newton form one can combine the terms to
find the coefficients of the polynomial. With the Lagrange form I found
it too difficult to develop an algorithm for this for the general case.
However, with the Newton form I found a compact and effective algorithm.
See below.
let n = the number of points - 1
let array x be initialized with the x values of the given points
let array c be initialized with the y values of the given points
Construct the backward divided differences table. The following is from
Algorithm 4.3 of Conte and de Boor's Elementary Numerical Analysis,
second edition (page 204). "Calculation of the coefficients for the
Newton form."
Array c now holds the coefficients of the polynomial. Its first entry
c[0] is the coefficient of the term of highest degree and c[n] is the
constant term. Therefore f(a) can be determined for a given value a as
follows.