------------------------------------------------------------------------ IMSL Name: RATCH/DRATCH (Single/Double precision version) Revised: May 31, 1991 Purpose: Compute a rational weighted Chebyshev approximation to a continuous function on an interval. Usage: CALL RATCH (F, PHI, WEIGHT, A, B, N, M, P, Q, ERROR) Arguments: F - User-supplied FUNCTION to be approximated. The form is F(X), where X - Independent variable. (Input) F - The function value. (Output) F must be declared EXTERNAL in the calling program. PHI - User-supplied FUNCTION to supply the variable transformation which must be continuous and monotonic. The form is PHI(X), where X - Independent variable. (Input) PHI - The function value. (Output) PHI must be declared EXTERNAL in the calling program. WEIGHT - User-supplied FUNCTION to scale the maximum error. It must be continuous and nonvanishing on the closed interval (A,B). The form is WEIGHT(X), where X - Independent variable. (Input) WEIGHT - The function value. (Output) WEIGHT must be declared EXTERNAL in the calling program. A - Lower end of the interval on which the approximation is desired. (Input) B - Upper end of the interval on which the approximation is desired. (Input) N - The degree of the numerator. (Input) M - The degree of the denominator. (Input) P - Vector of length N+1 containing the coefficients of the numerator polynomial. (Output) Q - Vector of length M+1 containing the coefficients of the denominator polynomial. (Output) ERROR - Min-max error of approximation. (Output) Remarks: 1. Automatic workspace usage is RATCH (N+M+8)*(N+M+2)+N+M+2 units, or DRATCH 2*(N+M+8)*(N+M+2)+N+M+2 units. Workspace may be explicitly provided, if desired, by use of R2TCH/DR2TCH. The reference is CALL R2TCH (F, PHI, WEIGHT, A, B, N, M, P, Q, ERROR, ITMAX, IWK, WK) The additional arguments are as follows: ITMAX - Maximum number of iterations. (Input) The default value is 20. IWK - Workspace vector of length (N+M+2). (Workspace) WK - Workspace vector of length (N+M+8)*(N+M+2). (Workspace) 2. Informational errors Type Code 3 1 The maximum number of iterations has been reached. The routine R2TCH may be called directly to set a larger value for ITMAX. 3 2 The error was reduced as far as numerically possible. A good approximation is returned in P and Q, but this does not necessarily give the Chebyshev approximation. 4 3 The linear system that defines P and Q was found to be algorithmically singular. This indicates the possibility of a degenerate approximation. 4 4 A sequence of critical points that was not monotonic generated. This indicates the possibility of a degenerate approximation. 4 5 The value of the error curve at some critical point is too large. This indicates the possibility of poles in the rational function. 4 6 The weight function cannot be zero on the closed interval (A,B). Keywords: Rational L approximation; L-infinity; Minimax GAMS: K2 Chapter: MATH/LIBRARY Interpolation and Approximation Page No.: MATH/LIBRARY User's Manual page 676