divdif, a C++ code which creates, prints and manipulates divided difference polynomials.
Divided difference polynomials are a systematic method of computing polynomial approximations to scattered data. The representations are compact, and may easily be updated with new data, rebased at zero, or analyzed to produce the standard form polynomial, integral or derivative polynomials.
Other routines are available to convert the divided difference representation into standard polynomial format. This is a natural way to determine the coefficients of the polynomial that interpolates a given set of data, for instance.
One surprisingly simple but useful routine is available to take a set of roots and compute the divided difference or standard form polynomial that passes through those roots.
Finally, the Newton-Cotes quadrature formulas can be derived using divided difference methods, so a few routines are given which can compute the weights and abscissas of open or closed rules for an arbitrary number of nodes.
The computer code and data files described and made available on this web page are distributed under the MIT license
divdif is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
BERNSTEIN_POLYNOMIAL, a C++ code which evaluates the Bernstein polynomials, useful for uniform approximation of functions;
CHEBYSHEV, a C++ code which computes the Chebyshev interpolant/approximant to a given function over an interval.
DIFFER, a C++ code which determines the finite difference coefficients necessary in order to combine function values at known locations to compute an approximation of given accuracy to a derivative of a given order.
LAGRANGE_INTERP_1D, a C++ code which defines and evaluates the Lagrange polynomial p(x) which interpolates a set of data, so that p(x(i)) = y(i).
RBF_INTERP, a C++ code which defines and evaluates radial basis function (RBF) interpolants to multidimensional data.
SPLINE, a C++ code which includes many routines to construct and evaluate spline interpolants and approximants.
TEST_APPROX, a C++ code which defines test problems for approximation, provided as a set of (x,y) data.
TEST_INTERP_1D, a C++ code which defines test problems for interpolation of data y(x), depending on a 1D argument.