SEAL icon indicating copy to clipboard operation
SEAL copied to clipboard

Non-linear function Issue

Open macknight opened this issue 3 years ago • 3 comments

Hi, Could Seal evaluate any non-linear function like sin(x), cos(x) or e^x or x^1/3 ?

BR

macknight avatar Aug 17 '22 15:08 macknight

Homomorphic encryption can evaluate non-linear non-polynomial functions by approximating them with high-degree polynomials or by looking up a table, just like how computers discretize continuous functions.

WeiDaiWD avatar Aug 23 '22 04:08 WeiDaiWD

Dear SEAL team, Do you have relative examples to evaluate non-linear functions by approximating them with large-degree polynomials or by looking up a table?

BR

macknight avatar Sep 07 '22 03:09 macknight

This paper shows an example on how to apply polynomial approximation for comparison in CKKS. Looking up a table is evaluating a multiplexer:

switch (x):
  case 0: return result_0;
  case 1: return result_1;
  case 2: return result_2;
  //...
  case 15: return result_15;
  default: return -1; // input out of range

WeiDaiWD avatar Sep 09 '22 17:09 WeiDaiWD