eval_chebyshev_coefficients: Chebyshev coefficients for a real-valued function

View source: R/methods-ckks.R

eval_chebyshev_coefficientsR Documentation

Chebyshev coefficients for a real-valued function

Description

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.

Usage

eval_chebyshev_coefficients(func, a, b, degree)

Arguments

func

An R function taking a single numeric argument and returning a numeric scalar.

a

Lower bound of the approximation interval.

b

Upper bound of the approximation interval.

degree

Chebyshev polynomial degree (must be >= 1).

Value

Numeric vector of length degree + 1.

See Also

eval_chebyshev(), eval_chebyshev_function().


openfhe.R documentation built on Nov. 13, 2026, 5:07 p.m.