Function lupnt::cheby_eval

Function Documentation

void lupnt::cheby_eval(double x, double *scale, double *coeff, long num, double *f, double *df)

Evaluate the given Chebyshev polynomial at x, returning both the evaluated polynomial in *f, and the evaluated derivative of the polymonial in df. The number of coefficients is num (the degree of the polynomial is num - 1), and the coefficients are coeff[0..num-1]. The first coefficient coeff[0] is the constant term. The scaling of x is provided by the midpoint scale[0] and the radius scale[1]. x must fall in the range scale[0] - scale[1] to scale[0] + scale[1]. Outside of that range, the polynomial is not valid.