Common Lisp Package: CL-NUM-UTILS.CHEBYSHEV

README:

FUNCTION

Public

CHEBYSHEV-APPROXIMATE (F INTERVAL N-POLYNOMIALS &KEY (N-POINTS N-POLYNOMIALS))

Return a closure approximating F on the given INTERVAL (may be infinite on either end) using the given number of Chebyshev polynomials.

CHEBYSHEV-EVALUATE (COEFFICIENTS X)

Return the sum of Chebyshev polynomials, weighted by COEFFICIENTS, at X.

CHEBYSHEV-REGRESSION (F N-POLYNOMIALS &OPTIONAL (N-POINTS N-POLYNOMIALS))

Chebyshev polynomial regression using the given number of polynomials and points (zeroes of the corresponding Chebyshev polynomial).

CHEBYSHEV-ROOT (M I)

Return the iTH root of the Mth Chebyshev polynomial as double-float.

CHEBYSHEV-ROOTS (M)

Return the roots of the Mth Chebyshev polynomial as a vector of double-floats.

Private

AB-TO-CD-INTERCEPT-SLOPE (A B C D)

Return (values INTERCEPT SLOPE) for linear mapping x:-> intercept+slope*x from [a,b] to [c,d].

AB-TO-CINF (Z A B C)

Inverse of cinf-to-ab.

CHEBYSHEV-RECURSION (X VALUE PREVIOUS-VALUE)

Chebyshev polynomial recursion formula.

CINF-TO-AB (X A B C)

Map x in [c,plus-infinity) to z in [a,b] using x -> (x-c)/(1+x-c)+(b-a)+a.

GENERIC-FUNCTION

Private

CHEBYSHEV-APPROXIMATE-IMPLEMENTATION (F INTERVAL N-POLYNOMIALS N-POINTS)

Implementation of CHEBYSHEV-APPROXIMATE.