polynomial-0.5: Polynomials

Math.Polynomial.Chebyshev

Synopsis

# Documentation

ts :: [Poly Integer]Source

The Chebyshev polynomials of the first kind with `Integer` coefficients.

t :: Num a => Int -> Poly aSource

Compute the coefficients of the n'th Chebyshev polynomial of the first kind.

u :: Num a => Int -> Poly aSource

Compute the coefficients of the n'th Chebyshev polynomial of the second kind.

evalT :: Num a => Int -> a -> aSource

Evaluate the n'th Chebyshev polynomial of the first kind at a point X. Both more efficient and more numerically stable than computing the coefficients and evaluating the polynomial.

evalTs :: Num a => a -> [a]Source

Evaluate all the Chebyshev polynomials of the first kind at a point X.

evalU :: Num a => Int -> a -> aSource

Evaluate the n'th Chebyshev polynomial of the second kind at a point X. Both more efficient and more numerically stable than computing the coefficients and evaluating the polynomial.

evalUs :: Num a => a -> [a]Source

Evaluate all the Chebyshev polynomials of the second kind at a point X.

evalTU :: Num a => Int -> a -> (a, a)Source

Evaluate the n'th Chebyshev polynomials of both kinds at a point X.

evalTsUs :: Num a => a -> ([a], [a])Source

Evaluate all the Chebyshev polynomials of the both kinds at a point X.

tRoots :: Floating a => Int -> [a]Source

Compute the roots of the n'th Chebyshev polynomial of the first kind.

tExtrema :: Floating a => Int -> [a]Source

Compute the extreme points of the n'th Chebyshev polynomial of the first kind.

chebyshevFit :: Floating a => Int -> (a -> a) -> [a]Source

`chebyshevFit n f` returns a list of N coefficients `cs` such that `f x` ~= `sum (zipWith (*) cs (evalTs x))` on the interval -1 < x < 1.

The N roots of the N'th Chebyshev polynomial are the fitting points at which the function will be evaluated and at which the approximation will be exact. These points always lie within the interval -1 < x < 1. Outside this interval, the approximation will diverge quickly.

This function deviates from most chebyshev-fit implementations in that it returns the first coefficient pre-scaled so that the series evaluation operation is a simple inner product, since in most other algorithms operating on chebyshev series, that factor is almost always a nuissance.

evalChebyshevSeries :: Num a => [a] -> a -> aSource

Evaluate a Chebyshev series expansion with a finite number of terms.

Note that this function expects the first coefficient to be pre-scaled by 1/2, which is what is produced by `chebyshevFit`. Thus, this computes a simple inner product of the given list with a matching-length sequence of chebyshev polynomials.