(* Sqrt *)
(* Direct transcription of an old proof of a fortran program in boyer-moore *)

(* sqrt2 *)
Lemma sqrt2_step_def rec ih il j:
sqrt2_step rec ih il j =
if (ih <? j)%uint63 then
let quo := fst (diveucl_21 ih il j) in
if (quo <? j)%uint63 then
let m :=
match j +c quo with
| C0 m1 => m1 >> 1
| C1 m1 => (m1 >> 1 + 1 << (digits -1))%uint63
end in
rec ih il m
else j
else j.