Square root digit recurrence algorithm

246 Views Asked by At

I'm reading a book which expose how to compute a square root using the digit recurrence algorithm. Following the book basically it expose a simple case with each step necessary to compute such square root and then it get the recurrence:

if we have: $z = z_{1}z_{0}.z_{-1} ... z_{-l}$ we want a square root $q = 1.q_{-1}q_{-2}...q_{-l}$ with reminder $s_1 s_0 . s_{-1} ... s_{-l}$

$$s^{(j)} = 2s^{(j-1)} - q_{-j} (2q^{(-j)} + 2^{-j}q_{-j})$$ with $s^{(0)} = z - 1, q^{(0)} = 1, s^{l} = s$

If you try to derive the recurrence for a division $x/y = z$ we basically look at some $z$ such that $x = z*y + s$ ($s$ is the reminder) if we expand $y$ with it's binary representation we can easily get the recurrence.

So basically the approach we use to derive the division recurrence isn't related to a specific example in the derivation, while in the case of the square root the book i'm reading starts with a specific case and then say "with this computation we can easily say that the recurrence is...".

So my question is... could be it possible to derive the recurrence in a similar way as the division? (i mean derive the recurrence from a general case). if yes what should be the rationale?