How to calculate manually Error : Degree [X] must be less than or equal to the correction factor [Y]

Hello everyone, I have a question. When manually searching for precision bounds and using scaleModSize=40, I still get solutions. However, when I reduce it to 39, I encounter the following error:

what():  /usr/lib/openfhe-development/src/pke/lib/scheme/ckksrns/ckksrns-fhe.cpp:l.455:EvalBootstrap(): Degree [13] must be less than or equal to the correction factor [10].

Obviously, the correction factor or scaling factor is smaller than the degree of the polynomial. Is there a method to automatically calculate the degree so that I don’t have to manually search for lower bounds? Thanks in advance

1 Like

Based on the error message, you seem to be asking about CKKS bootstrapping. When CKKS bootstrapping is used, FirstModSize should not exceed ScaleModSize by too many bits (10-12 or so). It sounds like you reduced scaleModSize to 39, while keeping FirstModSize at 60 (or some other high value). You should reduce FirstModSize to 50 or so. Please keep in mind that using ScaleModSize = 39 for bootstrapping will result in very low precision, so I would not recommend using such small values in principle.