It is expected that a common use of E02BBF will be the evaluation of the cubic spline approximations produced by E02BAF. A generalization of E02BBF which also forms the derivative of is E02BCF. E02BCF takes about longer than E02BBF.
Cox M G (1972) The numerical evaluation of B-splines J. Inst. Math. Appl.10 134–149
Cox M G (1978) The numerical evaluation of a spline from its B-spline representation J. Inst. Math. Appl.21 135–143
Cox M G and Hayes J G (1973) Curve fitting: a guide and suite of algorithms for the non-specialist user NPL Report NAC26 National Physical Laboratory
de Boor C (1972) On calculating with B-splines J. Approx. Theory6 50–62
1: NCAP7 – INTEGERInput
On entry: , where is the number of intervals (one greater than the number of interior knots, i.e., the knots strictly within the range to ) over which the spline is defined.
On entry: the coefficient
of the B-spline , for . The remaining elements of the array are not referenced.
4: X – REAL (KIND=nag_wp)Input
On entry: the argument at which the cubic spline is to be evaluated.
5: S – REAL (KIND=nag_wp)Output
On exit: the value of the spline, .
6: IFAIL – INTEGERInput/Output
On entry: IFAIL 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.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6 Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by X04AAF).
In this case the value of S is set arbitrarily to zero.
, i.e., the number of interior knots is negative.
The computed value of has negligible error in most practical situations. Specifically, this value has an absolute error bounded in modulus by , where is the largest in modulus of and , and is an integer such that . If and are all of the same sign, then the computed value of has a relative error not exceeding in modulus. For further details see Cox (1978).
8 Further Comments
The time taken is approximately seconds, where C is a machine-dependent constant.
Note: the routine does not test all the conditions on the knots given in the description of LAMDA in Section 5, since to do this would result in a computation time approximately linear in instead of . All the conditions are tested in E02BAF, however.
Evaluate at nine equally-spaced points in the interval the cubic spline with (augmented) knots , , , , , , , , , , and normalized cubic B-spline coefficients , , , , , , .
The example program is written in a general form that will enable a cubic spline with intervals, in its normalized cubic B-spline form, to be evaluated at equally-spaced points in the interval . The program is self-starting in that any number of datasets may be supplied.