This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Chebyshev approximations.
> > Andrea Riciputi writes:
> >> Reading the reference manual's chapter about Chebyshev
> >> approximation it's not clear (at least to me) how the c_n are
> >> defined. In particular I've found out that I've to double all the
> >> coefficients I've calculated by my own, in order to get
> >> gsl_cheb_eval to work properly. My c_n definition is: c_n = k
> >> \int{0}{\pi} f(x) \cos(n x) dx where k = 2/pi if n != 0 and k =
> >> 1/pi if n == 0. Given these definitions the series expansion is:
> >> f(x) = \sum{k = 0}{N} c_k cos(k x) Where am I wrong?
> >
> > I think it's a bug -- the implementation is different from the
> > definition given in the manual, there is a factor of 0.5 which needs
> > to be moved from the eval function to the init function.
> >
I looked at it closer and it's just c[0] that follows a different
convention. The series is c[0]/2 + sum_{n=1} c_n T_n(x), as opposed
to sum c_n T_n(x). I've added that to the manual to make it clearer.
--
Brian Gough
Network Theory Ltd
15 Royal Park
Bristol BS8 3AL
United Kingdom
Tel: +44 (0)117 3179309
Fax: +44 (0)117 9048108
Web: http://www.network-theory.co.uk/