Is there a possibility to calculate atan2? It tookes two input parameters, therefore I’m struggeling with cc->EvalChebyshevFunction
Hi. I’d recommend you read up on the wikipedia article. in it you see that :
so one might try first the eval division function then an eval chebychev polynomial approximation of atan. However if you read the article you can see there needs to be a correction if x< 0, so depending on your case this may or may not be sufficient. testing for sign in CKKS requires scheme switching back and forth to BinFHE, which is achievable, but I warn it takes compute time.
In all cases, chebychev is an interpolation function, care must be taken that the inputs are not out of bounds defined as input parameters, as the result will be useless otherwise.
Dave
OpenFHE only implements a univariate version of Chebyshev polynomial approximation. If you have a multivariate function, you either transform it into an univariate function by some prior pre-processing and use EvalChebyshevFunction, or if that is not possible, you can try to implement your own multivariate polynomial interpolation (significantly more effort).