NAG Library Routine Document
e02acf
(withdraw_1dmmax)
1
Purpose
e02acf calculates a minimax polynomial fit to a set of data points.
2
Specification
Fortran Interface
Integer, Intent (In) | :: |
n,
m1 | Real (Kind=nag_wp), Intent (In) | :: |
x(n),
y(n) | Real (Kind=nag_wp), Intent (Out) | :: |
a(m1),
ref |
|
C Header Interface
#include nagmk26.h
void |
e02acf_ (
const double x[],
const double y[],
const Integer *n,
double a[],
const Integer *m1,
double *ref) |
|
3
Description
Given a set of data points
, for
,
e02acf uses the exchange algorithm to compute an
th-order polynomial
such that
is a minimum.
The routine also returns a number whose absolute value is the final reference deviation (see
Section 6). The routine is an adaptation of
Boothroyd (1967).
4
References
Boothroyd J B (1967) Algorithm 318 Comm. ACM 10 801
Stieffel E (1959) Numerical methods of Tchebycheff approximation On Numerical Approximation (ed R E Langer) 217–232 University of Wisconsin Press
5
Arguments
- 1: – Real (Kind=nag_wp) arrayInput
-
On entry: the values of the coordinates,
, for .
Constraint:
.
- 2: – Real (Kind=nag_wp) arrayInput
-
On entry: the values of the coordinates,
, for .
- 3: – IntegerInput
-
On entry: the number of data points.
- 4: – Real (Kind=nag_wp) arrayOutput
-
On exit: the coefficients
of the final polynomial, for .
- 5: – IntegerInput
-
On entry: , where is the order of the polynomial to be found.
Constraint:
.
- 6: – Real (Kind=nag_wp)Output
-
On exit: the final reference deviation (see
Section 6).
6
Error Indicators and Warnings
If an error is detected in an input argument
e02acf will act as if a soft noisy exit has been requested (see
Section 3.4.4 in How to Use the NAG Library and its Documentation).
7
Accuracy
This is wholly dependent on the given data points.
8
Parallelism and Performance
e02acf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The time taken increases with .
10
Example
This example calculates a minimax fit with a polynomial of degree to the exponential function evaluated at points over the interval . It then prints values of the function and the fitted polynomial.
10.1
Program Text
Program Text (e02acfe.f90)
10.2
Program Data
None.
10.3
Program Results
Program Results (e02acfe.r)