| (9.24) |
where f(xi) are the known values of the function
and f(x) is the desired value of the function. The Lagrange
polynomial PLi is the polynomial of order
N-1 that has the value 1 when x=xi and
0 for all
:
| (9.25) |
This is a particularly convenient way to interpolate among tabulated values with polynomials.
An advantage of Lagrange interpolation is that the method does not need evenly spaced values in x. However, it is usually preferable to search for the nearest value in the table and then use the lowest-order interpolation consistent with the functional form of the data. High-order polynomials that match many entries in the table simultaneously can introduce undesirable rapid fluctuations between tabulated values. If used for extrapolation with a high-order polynomial, this method may give serious errors.