DIVDIF
Divided Difference Polynomials
DIVDIF
is a MATLAB library 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 to 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.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Related Data and Programs:
DIVDIF is available in
a C++ version and
a FORTRAN90 version and
a MATLAB version.
PPPACK
is a FORTRAN90 library which
defines piecewise polynomial functions,
including, in particular, cubic splines.
SPLINE
is a MATLAB library which
includes many routines to construct
and evaluate spline interpolants and approximants.
TEST_APPROX
is a FORTRAN90 library which
defines a number of test problems
for approximation and interpolation.
Reference:
-
Carl deBoor,
A Practical Guide to Splines,
Springer, 2001,
ISBN: 0387953663,
LC: QA1.A647.v27.
-
Jean-Paul Berrut, Lloyd Trefethen,
Barycentric Lagrange Interpolation,
SIAM Review,
Volume 46, Number 3, September 2004, pages 501-517.
-
FM Larkin,
Root Finding by Divided Differences,
Numerische Mathematik,
Volume 37, pages 93-104, 1981.
Source Code:
-
data_to_dif.m,
computes a divided difference table.
-
data_to_dif_display.m,
computes a divided difference table and shows how.
-
data_to_r8poly.m,
computes the coefficients of a polynomial interpolating data.
-
dif_antideriv.m,
computes the antiderivative of a divided difference polynomial.
-
dif_append.m,
adds a pair of data values to a divided difference table.
-
dif_basis.m,
computes all Lagrange basis polynomials in divided difference form.
-
dif_basis_i.m,
computes the I-th Lagrange basis polynomial in divided difference form.
-
dif_deriv.m,
computes the derivative of a polynomial in divided difference form.
-
dif_print.m,
prints the polynomial represented by a divided difference table.
-
dif_shift_x.m,
replaces one abscissa of a divided difference table with a new one.
-
dif_shift_zero.m,
shifts a divided difference table so that all abscissas are zero.
-
dif_to_r8poly.m,
converts a divided difference table to standard polynomial form.
-
dif_val.m,
evaluates a divided difference polynomial at a point.
-
nc_rule.m,
computes the weights of a Newton-Cotes quadrature rule.
-
ncc_rule.m,
computes the coefficients of a Newton-Cotes closed quadrature rule.
-
nco_rule.m,
computes the coefficients of a Newton-Cotes open quadrature rule.
-
r8poly_ant_cof.m,
integrates a polynomial in standard form.
-
r8poly_ant_val.m,
evaluates the antiderivative of a polynomial in standard form.
-
r8poly_basis.m,
computes all Lagrange basis polynomials in standard form.
-
r8poly_basis_1.m,
computes the I-th Lagrange basis polynomial in standard form.
-
r8poly_der_cof.m,
computes the coefficients of the derivative of a polynomial.
-
r8poly_der_val.m,
evaluates the derivative of a polynomial in standard form.
-
r8poly_order.m,
returns the order of a polynomial.
-
r8poly_print.m,
prints out a polynomial.
-
r8poly_shift.m,
adjusts the coefficients of a polynomial for a new argument.
-
r8poly_val_horner.m,
evaluates a polynomial in standard form.
-
r8vec_distinct.m,
is true if the entries in an R8VEC are distinct.
-
r8vec_indicator.m,
sets an R8VEC to the indicator vector A(I)=I.
-
r8vec_print.m,
prints an R8VEC.
-
roots_to_dif.m,
sets up a divided difference table for a polynomial from its roots.
-
roots_to_r8poly.m,
converts polynomial roots to polynomial coefficients.
-
s_len_trim.m,
returns the length of a string to the last nonblank.
-
timestamp.m,
prints the current YMDHMS date as a time stamp.
Examples and Tests:
-
divdif_test.m, calls all the tests;
-
divdif_test_output.txt,
the output file.
-
divdif_test01.m,
tests DATA_TO_DIF_DISPLAY, DIF_APPEND, DIF_ANTIDERIV,
DIF_DERIV, DIF_SHIFT_ZERO, and DIF_VAL;
-
divdif_test02.m,
tests DATA_TO_DIF and DIF_VAL;
-
divdif_test04.m,
tests DIF_BASIS;
-
divdif_test05.m,
tests R8POLY_BASIS;
-
divdif_test06.m,
tests DIF_TO_R8POLY and DIF_SHIFT_ZERO;
-
divdif_test07.m,
tests NCC_RULE;
-
divdif_test08.m,
tests NCO_RULE;
-
divdif_test09.m,
tests R8POLY_ANT_COF, R8POLY_ANT_VAL, R8POLY_DER_COF, R8POLY_DER_VAL,
R8POLY_PRINT, and R8POLY_VAL.
-
divdif_test10.m,
tests ROOTS_TO_DIF and DIF_TO_R8POLY.
-
divdif_test11.m,
tests ROOTS_TO_R8POLY.
-
divdif_test12.m,
tests R8POLY_SHIFT.
You can go up one level to
the MATLAB source codes.
Last modified on 07 October 2006.