View source: R/key-switching.R
| eval_chebyshev_function_ptxt | R Documentation |
The cleartext counterpart of eval_chebyshev_function(): it
evaluates the degree-degree Chebyshev approximation of func on
[a, b] at the points ptxt, with the arithmetic OpenFHE uses on
ciphertexts. Comparing its result with func(ptxt) gives the
approximation error of a degree before any encrypted computation
is run.
eval_chebyshev_function_ptxt(func, ptxt, a, b, degree)
func |
A function of one number returning one number. |
ptxt |
Numeric vector of points in |
a, b |
Numeric; the interval. |
degree |
Integer; the degree of the approximation, at least 1. |
A numeric vector the length of ptxt.
x <- seq(-1, 1, by = 0.5)
eval_chebyshev_function_ptxt(exp, x, -1, 1, 8L) - exp(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.