# Divisions and Square Roots with Tight Error Analysis from Newton–Raphson Iteration in Secure Fixed-Point Arithmetic

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Preliminaries

#### 2.1. Secure Computation

#### 2.2. Secure Fixed-Point Arithmetic

**Remark**

**1.**

#### 2.3. Probabilistic Rounding

**Remark**

**2.**

Algorithm 1 ${\mathsf{Round}}_{\nu}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right],\mathrm{m}\mathrm{o}\mathrm{d}\mathrm{e}=\mathrm{p}\mathrm{r}\mathrm{o}\mathrm{b}\mathrm{a}\mathrm{b}\mathrm{i}\mathrm{l}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | $-{2}^{\ell +\nu -1}\le a<{2}^{\ell +\nu -1}$ | |

1: | if mode = deterministic then | |

2: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow \left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]+{2}^{\nu -1}$ | |

3: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{r}_{0}\right]\phantom{\rule{-0.166667em}{0ex}}\right],\dots ,\left[\phantom{\rule{-0.166667em}{0ex}}\left[{r}_{\nu -1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]{\in}_{R}\{0,1\}$ | ▹$\nu $ random bits |

4: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[r\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\sum}_{i=0}^{\nu -1}\left[\phantom{\rule{-0.166667em}{0ex}}\left[{r}_{i}\right]\phantom{\rule{-0.166667em}{0ex}}\right]{2}^{i}$ | |

5: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{r}^{\prime}\right]\phantom{\rule{-0.166667em}{0ex}}\right]{\in}_{R}\{0,1,\dots ,{2}^{\kappa +\ell}-1\}$ | ▹ security parameter $\kappa $ |

6: | $c\leftarrow \mathsf{Open}({2}^{\ell -1+\nu}+\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]+\left[\phantom{\rule{-0.166667em}{0ex}}\left[r\right]\phantom{\rule{-0.166667em}{0ex}}\right]+{2}^{\nu}\left[\phantom{\rule{-0.166667em}{0ex}}\left[{r}^{\prime}\right]\phantom{\rule{-0.166667em}{0ex}}\right])$ | |

7: | ${c}^{\prime}\leftarrow c\phantom{\rule{3.33333pt}{0ex}}mod\phantom{\rule{0.277778em}{0ex}}{2}^{\nu}$ | |

8: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow (\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]+\left[\phantom{\rule{-0.166667em}{0ex}}\left[r\right]\phantom{\rule{-0.166667em}{0ex}}\right]-{c}^{\prime})\phantom{\rule{0.166667em}{0ex}}/\phantom{\rule{0.166667em}{0ex}}{2}^{\nu}$ | ▹$b={\lfloor a/{2}^{\nu}\rceil}_{\phantom{\rule{-0.166667em}{0ex}}\$}$ |

9: | if mode = deterministic then | |

10: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow \left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]-({c}^{\prime}<\left[\phantom{\rule{-0.166667em}{0ex}}\left[r\right]\phantom{\rule{-0.166667em}{0ex}}\right])$ | ▹$b=\lfloor a/{2}^{\nu}\rceil $ |

11: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\right[b\left]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{\ell -1}\le b<{2}^{\ell -1}$ |

#### 2.4. Newton–Raphson Method

## 3. Reciprocal

#### 3.1. Secure Computation

Algorithm 2 $\mathsf{Reciprocal}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}],n=0)$ | $-{2}^{\ell -1}\le a<{2}^{\ell -1}$ | |

1: | $\left[\phantom{\rule{-0.166667em}{0ex}}\right[v\left]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow \mathsf{Scale}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\left]\right)$ | ▹$v=\pm {2}^{k},k\in \mathbb{Z}$ |

2: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f-n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | ▹${2}^{f+n-1}\le b<{2}^{f+n}$ |

3: | $\alpha \leftarrow 3/2-\sqrt{2}$ | |

4: | $\theta \leftarrow \lceil {log}_{2}{log}_{\alpha}{2}^{-(f+n)}\rceil $ | |

5: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{0}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow (3-\alpha ){2}^{f}-2\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | |

6: | for $i=1$ to $\theta $ do | |

7: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[z\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow 2-{\mathsf{Round}}_{f+n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i-1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | |

8: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i-1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[z\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | |

9: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{d}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+n}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right],\phantom{\rule{0.166667em}{0ex}}\mathrm{d}\mathrm{e}\mathrm{t}\mathrm{e}\mathrm{r}\mathrm{m}\mathrm{i}\mathrm{n}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | |

10: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{d}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{\ell -1}\le {d}_{\theta}<{2}^{\ell -1}$ |

**Remark**

**3.**

#### 3.2. Tight Error Analysis without Scaling

**Theorem**

**1.**

**Proof.**

#### 3.3. Tight Error Analysis

**Theorem**

**2.**

**Proof.**

**Remark**

**4.**

**Corollary**

**1.**

**Proof.**

## 4. Integer Division

#### 4.1. Error for Integer Division

Algorithm 3 $\mathsf{IntDivFxp}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[g\right]\phantom{\rule{-0.166667em}{0ex}}],[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}],n=1)$ | $-{2}^{\ell -1}\le g,a<{2}^{\ell -1}$, with $g,a\phantom{\rule{3.33333pt}{0ex}}\in {2}^{f}\mathbb{Z}$ | |

Lines 1–8 of Algorithm 2 | ||

Line 2 simplifies to $\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {2}^{-f+n}\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ||

9: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[w\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {2}^{-f}\left[\phantom{\rule{-0.166667em}{0ex}}\left[g\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | |

10: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[\tilde{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[w\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | |

11: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\left[\tilde{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{\ell -1}\le \tilde{q}<{2}^{\ell -1}$ |

**Theorem**

**3.**

**Proof.**

#### 4.2. From Fixed-Point Approximation to Integer Solution

**Corollary**

**2.**

**Proof.**

**Remark**

**5.**

Algorithm 4 $\mathsf{IntDiv}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[g\right]\phantom{\rule{-0.166667em}{0ex}}],[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\left]\right)$ | $-{2}^{f-1}\le g,a<{2}^{f-1}$, with $g,a\in \mathbb{Z}$ | |

1: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[\tilde{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow \mathsf{IntDivFxp}([\phantom{\rule{-0.166667em}{0ex}}[g{2}^{f}]\phantom{\rule{-0.166667em}{0ex}}],[\phantom{\rule{-0.166667em}{0ex}}[a{2}^{f}]\phantom{\rule{-0.166667em}{0ex}}])$ | ▹$-{2}^{\ell -1}\le \tilde{q}<{2}^{\ell -1}$ |

2: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[\overline{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[\tilde{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right],\phantom{\rule{0.166667em}{0ex}}\mathrm{d}\mathrm{e}\mathrm{t}\mathrm{e}\mathrm{r}\mathrm{m}\mathrm{i}\mathrm{n}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | |

3: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[q\right]\phantom{\rule{-0.166667em}{0ex}}\right]=\left[\phantom{\rule{-0.166667em}{0ex}}\left[\overline{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]-(\left[\phantom{\rule{-0.166667em}{0ex}}\left[\overline{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]>\left[\phantom{\rule{-0.166667em}{0ex}}\left[g\right]\phantom{\rule{-0.166667em}{0ex}}\right])$ | |

4: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\right[q\left]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{f-1}\le q<{2}^{f-1}$ |

## 5. Reciprocal Square Root

#### 5.1. Secure Computation

Algorithm 5 $\mathsf{RecSqrt}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}],n=0)$ | $-{2}^{\ell -1}\le a<{2}^{\ell -1}$ | |

1: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right],[\phantom{\rule{-0.166667em}{0ex}}[{v}^{\frac{1}{2}}]\phantom{\rule{-0.166667em}{0ex}}]\leftarrow \mathsf{Scale}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | ▹$v=\pm {2}^{k},k\in \mathbb{Z}$, k even |

2: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f-n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | ▹${2}^{f+n-1}\le b<{2}^{f+n+1}$ |

3: | $\beta \leftarrow (\sqrt{2}-1)/4$ | |

4: | $\tau \leftarrow 3/\sqrt{2}$ | |

5: | $\theta \leftarrow \lceil {log}_{2}{log}_{\tau \beta}\left(\tau {2}^{-(f+n)}\right)\rceil $ | |

6: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{0}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow 3/2+\beta -{\mathsf{Round}}_{1}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]/2,\phantom{\rule{0.166667em}{0ex}}\mathrm{d}\mathrm{e}\mathrm{t}\mathrm{e}\mathrm{r}\mathrm{m}\mathrm{i}\mathrm{n}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | |

7: | for $i=1$ to $\theta $ do | |

8: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{z}_{1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i-1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right))$ | |

9: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{z}_{2}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow 3-{\mathsf{Round}}_{f+n}\left(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i-1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[{z}_{1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | |

10: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+n+1}\left({\textstyle \frac{1}{2}}\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{i-1}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[{z}_{2}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\right)$ | |

11: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{d}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+n}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right][\phantom{\rule{-0.166667em}{0ex}}[{v}^{\frac{1}{2}}]\phantom{\rule{-0.166667em}{0ex}}],\phantom{\rule{0.166667em}{0ex}}\mathrm{d}\mathrm{e}\mathrm{t}\mathrm{e}\mathrm{r}\mathrm{m}\mathrm{i}\mathrm{n}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | |

12: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{d}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{\ell -1}\le {d}_{\theta}<{2}^{\ell -1}$ |

#### 5.2. Tight Error Analysis without Scaling

**Theorem**

**4.**

**Proof.**

#### 5.3. Tight Error Analysis

**Theorem**

**5.**

**Proof.**

**Remark**

**6.**

**Corollary**

**3.**

**Proof.**

## 6. Square Root

#### 6.1. Error for Square Root

Algorithm 6 $\mathsf{Sqrt}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}],n=0)$ | $-{2}^{\ell -1}\le a<{2}^{\ell -1}$ | |

Lines 1–10 of Algorithm 5 | ||

11: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[w\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f-n}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right][\phantom{\rule{-0.166667em}{0ex}}[{v}^{\frac{1}{2}}]\phantom{\rule{-0.166667em}{0ex}}])$ | |

12: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{d}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f+2n}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[{c}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[w\right]\phantom{\rule{-0.166667em}{0ex}}\right],\phantom{\rule{0.166667em}{0ex}}\mathrm{d}\mathrm{e}\mathrm{t}\mathrm{e}\mathrm{r}\mathrm{m}\mathrm{i}\mathrm{n}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | |

13: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\left[{d}_{\theta}\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{\ell -1}\le {d}_{\theta}<{2}^{\ell -1}$ |

**Theorem**

**6.**

**Proof.**

**Corollary**

**4.**

**Proof.**

#### 6.2. Integer Square Root

**Corollary**

**5.**

**Proof.**

**Remark**

**7.**

Algorithm 7 $\mathsf{IntSqrt}\left(\right[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\left]\right)$ | $-{2}^{f-1}\le a<{2}^{f-1}$, with $a\in \mathbb{Z}$ | ||

Line 2 in Algorithm 6 simplifies to $\left[\phantom{\rule{-0.166667em}{0ex}}\left[b\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {2}^{-f+n}\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right]\left[\phantom{\rule{-0.166667em}{0ex}}\left[v\right]\phantom{\rule{-0.166667em}{0ex}}\right]$ | |||

1: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[\tilde{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow \mathsf{Sqrt}([\phantom{\rule{-0.166667em}{0ex}}[a{2}^{f}]\phantom{\rule{-0.166667em}{0ex}}],n=0)$ | ▹$-{2}^{\ell -1}\le \tilde{q}<{2}^{\ell -1}$ | |

2: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[\overline{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow {\mathsf{Round}}_{f}(\left[\phantom{\rule{-0.166667em}{0ex}}\left[\tilde{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right],\phantom{\rule{0.166667em}{0ex}}\mathrm{d}\mathrm{e}\mathrm{t}\mathrm{e}\mathrm{r}\mathrm{m}\mathrm{i}\mathrm{n}\mathrm{i}\mathrm{s}\mathrm{t}\mathrm{i}\mathrm{c})$ | ||

3: | $\left[\phantom{\rule{-0.166667em}{0ex}}\left[q\right]\phantom{\rule{-0.166667em}{0ex}}\right]\leftarrow \left[\phantom{\rule{-0.166667em}{0ex}}\left[\overline{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]-({\left[\phantom{\rule{-0.166667em}{0ex}}\left[\overline{q}\right]\phantom{\rule{-0.166667em}{0ex}}\right]}^{2}>\left[\phantom{\rule{-0.166667em}{0ex}}\left[a\right]\phantom{\rule{-0.166667em}{0ex}}\right])$ | ||

4: | return $\left[\phantom{\rule{-0.166667em}{0ex}}\right[q\left]\phantom{\rule{-0.166667em}{0ex}}\right]$ | ▹$-{2}^{f-1}\le q<{2}^{f-1}$ |

## 7. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Appendix A. Lemmas

#### Appendix A.1. Lemmas for the Reciprocal

**Lemma**

**A1.**

**Proof.**

**Lemma**

**A2.**

**Proof.**

**Lemma**

**A3.**

**Proof.**

**Lemma**

**A4.**

**Proof.**

#### Appendix A.2. Lemmas for the Reciprocal Square Root

**Lemma**

**A5.**

**Proof.**

**Lemma**

**A6.**

**Proof.**

**Lemma**

**A7.**

**Proof.**

## References

- Algesheimer, J.; Camenisch, J.; Shoup, V. Efficient computation modulo a shared secret with application to the generation of shared safe-prime products. In Advances in Cryptology—CRYPTO 2002; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2002; Volume 2442, pp. 417–432. [Google Scholar]
- Catrina, O.; de Hoogh, S. Secure multiparty linear programming using fixed-point arithmetic. In Computer Security—ESORICS 2010; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2010; Volume 6345, pp. 134–150. [Google Scholar]
- Catrina, O.; Saxena, A. Secure computation with fixed-point numbers. In Financial Cryptography and Data Security—FC 2010; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2010; Volume 6052, pp. 35–50. [Google Scholar]
- Liedel, M. Secure distributed computation of the square root and applications. In Information Security Practice and Experience—ISPEC 2012; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2012; Volume 7232, pp. 277–288. [Google Scholar]
- Aly, A.; Smart, N.P. Benchmarking privacy preserved scientific operations. In Applied Cryptography and Network Security—ACNS 2019; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2019; Volume 11464, pp. 509–529. [Google Scholar]
- Knuth, D.E. The Art of Computer Programming (Vol. 2: Seminumerical Algorithms), 3rd ed.; Addison Wesley: Reading, MA, USA, 1997. [Google Scholar]
- Wilkinson, J.H. Rounding Errors in Algebraic Processes; Prentice Hall: Englewood Cliffs, NJ, USA, 1963. [Google Scholar]
- Wilkinson, J.H. The algebraic eigenvalue problem. In Monographs on Numerical Analysis; Clarendon Press: Oxford, UK, 1965. [Google Scholar]
- Aly, A.; Nawaz, K.; Salazar, E.; Sucasas, V. Through the looking-glass: Benchmarking secure multi-party computation comparisons for ReLU’s. In Cryptology and Network Security—CANS 2022; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2022; Volume 13641, pp. 44–67. [Google Scholar]
- Damgård, I.; Fitzi, M.; Kiltz, E.; Nielsen, J.B.; Toft, T. Unconditionally secure constant-rounds multi-party computation for equality, comparison, bits and exponentiation. In Theory of Cryptography Conference—TCC 2006; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2006; Volume 3876, pp. 285–304. [Google Scholar]
- Damgård, I.; Nielsen, J.B. Universally composable efficient multiparty computation from threshold homomorphic encryption. In Advances in Cryptology—CRYPTO 2003; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2003; Volume 2729, pp. 247–264. [Google Scholar]
- Croci, M.; Giles, M.B. Effects of round-to-nearest and stochastic rounding in the numerical solution of the heat equation in low precision. IMA J. Numer. Anal.
**2022**, 43, 1358–1390. [Google Scholar] [CrossRef] - Na, T.; Ko, J.H.; Kung, J.; Mukhopadhyay, S. On-chip training of recurrent neural networks with limited numerical precision. In Proceedings of the 2017 International Joint Conference on Neural Networks (IJCNN), Anchorage, AK, USA, 14–19 May 2017; pp. 3716–3723. [Google Scholar]
- Paxton, E.A.; Chantry, M.; Klöwer, M.; Saffin, L.; Palmer, T. Climate modeling in low precision: Effects of both deterministic and stochastic rounding. J. Clim.
**2022**, 35, 1215–1229. [Google Scholar] [CrossRef] - Wang, N.; Choi, J.; Brand, D.; Chen, C.; Gopalakrishnan, K. Training deep neural networks with 8-bit floating point numbers. In Proceedings of the 32nd International Conference on Neural Information Processing Systems—NIPS 2018, Santa Barbara, CA, USA, 18–22 August 2002; Curran Associates, Inc.: Red Hook, NY, USA, 2018; pp. 7686–7695. [Google Scholar]
- Croci, M.; Fasi, M.; Higham, N.J.; Mary, T.; Mikaitis, M. Stochastic rounding: Implementation, error analysis and applications. R. Soc. Open Sci.
**2022**, 9, 211631. [Google Scholar] [CrossRef] - Ryaben’kii, V.S.; Tsynkov, S.V. A Theoretical Introduction to Numerical Analysis; Chapman and Hall/CRC: New York, NY, USA, 2006. [Google Scholar]
- Yamamoto, T. Historical developments in convergence analysis for Newton’s and Newton-like methods. J. Comput. Appl. Math.
**2000**, 124, 1–23. [Google Scholar] [CrossRef] - Ercegovac, M.; Lang, T. Digital Arithmetic; Morgan Kaufmann: San Francisco, CA, USA, 2004. [Google Scholar]
- Korzilius, S.; Schoenmakers, B. New approach for sine and cosine in secure fixed-point arithmetic. In Cyber Security, Cryptology, and Machine Learning—CSCML 2023; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2023; Volume 13914, pp. 307–319. [Google Scholar]
- Schoenmakers, B. MPyC Package for Secure Multiparty Computation in Python. GitHub. 2018. Available online: github.com/lschoe/mpyc (accessed on 7 September 2023).
- Schoenmakers, B.; Segers, T. Efficient Extended GCD and Class Groups from Secure Integer Arithmetic. In Cyber Security, Cryptology, and Machine Learning—CSCML 2023; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2023; Volume 13914, pp. 32–48. [Google Scholar]

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Korzilius, S.; Schoenmakers, B.
Divisions and Square Roots with Tight Error Analysis from Newton–Raphson Iteration in Secure Fixed-Point Arithmetic. *Cryptography* **2023**, *7*, 43.
https://doi.org/10.3390/cryptography7030043

**AMA Style**

Korzilius S, Schoenmakers B.
Divisions and Square Roots with Tight Error Analysis from Newton–Raphson Iteration in Secure Fixed-Point Arithmetic. *Cryptography*. 2023; 7(3):43.
https://doi.org/10.3390/cryptography7030043

**Chicago/Turabian Style**

Korzilius, Stan, and Berry Schoenmakers.
2023. "Divisions and Square Roots with Tight Error Analysis from Newton–Raphson Iteration in Secure Fixed-Point Arithmetic" *Cryptography* 7, no. 3: 43.
https://doi.org/10.3390/cryptography7030043