Learn R Programming

openfhe.R (version 1.6.1)

get_hermite_trig_coefficients: Trigonometric Hermite interpolation of a look-up table

Description

Computes the coefficients of the trigonometric Hermite interpolation of a function on the integers modulo p. They are the coeffs argument of eval_fbt() and its relatives in the general case.

Usage

get_hermite_trig_coefficients(func, p, order, scale)

Value

A complex vector.

Arguments

func

A function of one whole number in 0, ..., p - 1 returning one whole number: the look-up table.

p

Integer; the input plaintext modulus.

order

Integer; the order of the interpolation (1, 2 or 3).

scale

Numeric; the coefficients are divided by it. A scale that brings their magnitude near one is recommended; it is undone by the post_scaling argument of eval_fbt().

Examples

Run this code
get_hermite_trig_coefficients(function(x) x %% 4, p = 8L, order = 1L,
                              scale = 1)

Run the code above in your browser using DataLab