Computes the Chebyshev (first-kind) coefficients that approximate
a univariate function func on the interval \([a, b]\) using the
discrete orthogonality formula at degree + 1 Chebyshev nodes.
This is a direct port of the upstream routine
EvalChebyshevCoefficients() in
core/lib/math/chebyshev.cpp of openfhe-development, and the
returned vector is in exactly the form that
eval_chebyshev() (and the upstream EvalChebyshevSeries)
expect — the zeroth coefficient is not halved.
eval_chebyshev_coefficients(func, a, b, degree)Numeric vector of length degree + 1.
An R function taking a single numeric argument and returning a numeric scalar.
Lower bound of the approximation interval.
Upper bound of the approximation interval.
Chebyshev polynomial degree (must be >= 1).
eval_chebyshev(), eval_chebyshev_function().