That cryptic constant is actually a composite of three bitfields, and twiddling it requires some understanding of what those fields are. It would be clearer, but a few more operations, to do that line as a pair of bitfield extract/inserts. But we're saving divides in the subsequent iterations, so the extra 1-cycle operations are a wash.
== Pell's equation? ==
Pell's equation is a Diophantine equation, meaning it has integer coefficients, and requires an integer solution. So <math>S</math> in this case must be an integer (not zero and not a perfect square). Most of the time, we're not computing square roots of integers, because we can look them up. But let's just suppose we want the square root of 1361, First we come up against: ''Find positive integers p1 and q1... This is the hard part; It can be done either by guessing, or by using fairly sophisticated techniques.'' Guess?? This isn't the same kind of guessing we do in the Initial estimate section, because a bad guess there just means more work. No, a bad guess here is utterly worthless. There's no guessable solution to p<sup>2</sup> - 1361{{dot}}q<sup>2</sup>=1. (Yes, 1361 is prime, and has a few other properties that make it a particularly irascible number, but in the end, it's just an arbitrary number). The standard method of solving Diophantine equations is by continued fractions (one must find the period of the repetend); the problem is that the repetend may be long, extremely long, and it can be that long for seemingly innocuous choices of <math>S</math>. We don't elaborate that in the section.
Pell's equation is a recursive relationship that allows one to generate infinitely many solutions after finding one. It's finding one that's the hump, as it is with any Diophantine equation. And in the usual case, while there may be infinitely many solutions, none of them are small, small enough to make trial and error a useable approach. I don't think this section ought to be in the article, unless we greatly expand it to demonstrate how actually to solve the equation. Solving a Diophantine equation is a LOT more work than an arithmetic computation of square root. [[User:Sbalfour|Sbalfour]] ([[User talk:Sbalfour|talk]]) 22:09, 14 December 2019 (UTC)
:I agree. [[User:JRSpriggs|JRSpriggs]] ([[User talk:JRSpriggs|talk]]) 09:29, 15 December 2019 (UTC)
== What's the programming language used here? ==
|