# Estimated precision in CKKS w/ bootstrapping

**URL:** <https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659>\
**Category:** Library Questions\
**Created:** [October 21, 2024, 4:49pm UTC](https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659 "2024-10-21T16:49:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavinmoriya](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@bhavinmoriya](https://openfhe.discourse.group/u/bhavinmoriya)\
**Post date:** [October 21, 2024, 4:49pm UTC](https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659/1 "2024-10-21T16:49:34Z")

</div>

Hi,

I am doing some addition multiplication on a 1 batchsize vector. If I understand correctly – increasing the ring dimension security increases and estimated precision as well – at the cost of compute. But in my code if 2\*\*i multiplied to ring dimension decreases Est precision by i bits. May I know why this is happening?

Thank you very much.  
Bhavin.

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [October 21, 2024, 8:36pm UTC](https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659/2 "2024-10-21T20:36:00Z")

</div>

Could you please formulate the question in (correct) English? I do not understand what you are asking about as there are numerous grammatical errors. Other participants of the Discourse forum will not be able to understand this question either.

If you have a question about a particular example, please provide a minimal working example so we could understand what specific behavior you are referring to.

Thank you for understanding.

---

<div class="post-metadata">

**Author:** ![bhavinmoriya](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@bhavinmoriya](https://openfhe.discourse.group/u/bhavinmoriya)\
**Post date:** [October 23, 2024, 1:30pm UTC](https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659/3 "2024-10-23T13:30:52Z")

</div>

I am very sorry for not making it clear. The question is as follows,

I am interested in knowing how does ring dimension affect the estimated precision in the following code,

> <https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/advanced-ckks-bootstrapping.cpp>

I get following results,  
0. `parameters.SetRingDim(1 << 11);` Estimated precision: 26 bits

1. `parameters.SetRingDim(1 << 12);` Estimated precision: 25 bits
2. `parameters.SetRingDim(1 << 13);` Estimated precision: 25 bits
3. `parameters.SetRingDim(1 << 14);` Estimated precision: 21 bits
4. `parameters.SetRingDim(1 << 15);` Estimated precision: 18 bits

Motivation: Raising the security level to 128 bit and would like to maintain the estimated precision high as well.

Thank you very much.  
Bhavin.

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [October 24, 2024, 12:51pm UTC](https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659/4 "2024-10-24T12:51:42Z")

</div>

Thank you for clarifying. I suggest reading [Approximate Homomorphic Encryption with Reduced Approximation Error](https://eprint.iacr.org/2020/1118) to learn how the error (precision) in leveled CKKS depends on the ring dimension. In the case of bootstrapping, it gets even more complicated as there are several levels of approximation involved. If you need increased (roughly double) precision after bootstrapping, you can use iterative bootstrapping (see [openfhe-development/src/pke/examples/iterative-ckks-bootstrapping.cpp at main · openfheorg/openfhe-development · GitHub](https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/iterative-ckks-bootstrapping.cpp))

---

<div class="post-metadata">

**Author:** ![bhavinmoriya](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@bhavinmoriya](https://openfhe.discourse.group/u/bhavinmoriya)\
**Post date:** [October 27, 2024, 6:45pm UTC](https://openfhe.discourse.group/t/estimated-precision-in-ckks-w-bootstrapping/1659/5 "2024-10-27T18:45:15Z")

</div>

Thank you very much for the suggestion 🙂
