Hello, I am using chebyshev approximation to evaluate exp(x). The problem is that, even though values are in the interval, results are messy.
I am using 2^16 ring with security 128 bits, this is the key part of the code:
vector<double> v = {-5, -4, -3, -2, -1, 0, 0.1, 0.2, 0.3, 1, 2, 3, 4, 5, 6, 7, 8};
Plaintext p = cryptoContext->MakeCKKSPackedPlaintext(v, 1, 0, nullptr, numSlots);
Ciphertext<DCRTPoly> c = crypto_context->Encrypt(key_pair.publicKey, p);
c = crypto_context->EvalChebyshevFunction([](double x) -> double { return exp(x); }, c, -10, 10, 27);
When i print the decrypted results, i get something like this:
(-2.88821e+07, -2.86466e+07, -2.81768e+07, -2.72802e+07, -2.57516e+07, -2.33729e+07, -2.30795e+07, -2.2775e+07, -2.24593e+07, ...
Am I doing something wrong?