Chebyshev Approximation¶
A class implementing the Chebyshev approximations based on GSL is given in cheb_approx_tl. This class has its own copy constructor, so that Chebyshev approximations can be copied and passed as arguments to functions. Derivatives and integrals of cheb_approx_tl objects are created as new ref o2scl::cheb_approx_tl objects which can be easily manipulated.
Chebyshev approximation example¶
This example performs an approximation of the function \(y=\sin\left[ 1/\left(x+0.08 \right) \right]\) over \([0,2 \pi]\). This function oscillates strongly over this interval and requires a high order approximation to be accurate.
The image below shows the approximation for \(n=50\) \(n=25\). The \(n=100\) would be nearly indistinguishable from the exact result on this scale.
