Function lbcrypto::EvalChebyshevCoefficients
Defined in File chebyshev.cpp
Function Documentation
-
std::vector<double> lbcrypto::EvalChebyshevCoefficients(std::function<double(double)> f, double a, double b, uint32_t d)
Method for calculating Chebyshev coefficients for an input function over the range [a,b]. These coefficents are used in EValChebyshevSeries to approximate the function func as func(x) ~ coeffs[0]/2 + sum_{i=1}^{degree} coeffs[i] * T_{i}(x), where T_{i}(x) are Chebyshev polynomials of the first kind. (Note that the 1st coeffiicent is divided by two.)
- Parameters
func – is the function to be approximated
a – - lower bound of argument for which the coefficients were found
b – - upper bound of argument for which the coefficients were found
degree – Desired degree of approximation
- Returns
the coefficients of the Chebyshev approximation.