NAG Library Routine Document
D02UWF interpolates from a set of function values on a supplied grid onto a set of values for a uniform grid on the same range. The interpolation is performed using barycentric Lagrange interpolation. D02UWF is primarily a utility routine to map a set of function values specified on a Chebyshev Gauss–Lobatto grid onto a uniform grid.
||N, NIP, IFAIL
||X(N+1), F(N+1), XIP(NIP), FIP(NIP)
D02UWF interpolates from a set of
, on a supplied grid,
, onto a set of
, on a uniform grid,
. The image
has the same range as
, so that
. The interpolation is performed using barycentric Lagrange interpolation as described in Berrut and Trefethen (2004)
D02UWF is primarily a utility routine to map a set of function values specified on a Chebyshev Gauss–Lobatto grid computed by D02UCF
onto an evenly-spaced grid with the same range as the original grid.
Berrut J P and Trefethen L N (2004) Barycentric lagrange interpolation SIAM Rev. 46(3) 501–517
- 1: N – INTEGERInput
On entry: , where the number of grid points for the input data is .
- 2: NIP – INTEGERInput
On entry: the number, , of grid points in the uniform mesh onto which function values are interpolated. If then on successful exit from D02UWF, will contain the value .
- 3: X() – REAL (KIND=nag_wp) arrayInput
: the grid points,
, at which the function is specified.
Usually this should be the array of Chebyshev Gauss–Lobatto points returned in D02UCF
- 4: F() – REAL (KIND=nag_wp) arrayInput
On entry: the function values,
, for .
- 5: XIP(NIP) – REAL (KIND=nag_wp) arrayOutput
On exit: the evenly-spaced grid points,
, for .
- 6: FIP(NIP) – REAL (KIND=nag_wp) arrayOutput
On exit: the set of interpolated values
, for . Here .
- 7: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
|On entry,|| or N is odd.|
D02UWF is intended, primarily, for use with Chebyshev Gauss–Lobatto input grids. For such input grids and for well-behaved functions (no discontinuities, peaks or cusps), the accuracy should be a small multiple of machine precision.
This example interpolates the function , as specified on a -point Gauss–Lobatto grid on , onto a coarse uniform grid.
9.1 Program Text
Program Text (d02uwfe.f90)
9.2 Program Data
Program Data (d02uwfe.d)
9.3 Program Results
Program Results (d02uwfe.r)