Chebyshev circuit depth

Hello there, I am trying to evaluate the square root function within a certain interval [a, b] using the EvalChebyshevFunction. My question is, since I am using 8 as a degree, why the ciphertext goes up by 8 levels? Shouldn’t the evaluation be performed with a depth of log(8) = 4?

Thanks!

Can you post your code? It should not be going up by 8 levels for degree 8.

1 Like

To add on to what Saroja said, you can check OpenFHE - FUNCTION EVALUATION to read about how this works, and the appropriate depth

Uhm, now I get 5 levels consumed.

cout << "Level before: " << c->GetLevel() << endl;
auto res = ctx->EvalChebyshevFunction([](double x) -> double { return std::sqrt(x); }, c, 0.337, 3, 8);
cout << "Level after: " << res->GetLevel() <<endl;

gives output

Level before: 25
Level after: 30

I am using the default parameters from advanced_bootstrapping.cpp example, maybe the interval [0.377, 3] is not ok?

As Saroja said, please share your code