Documentation

CslibFrontier.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BandRoot

Native integer square root for the band block size #

Main results #

theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.BandPreparation.exec_root {w : ℕ} (k : ℕ) (x : WordRAM.Data 96) (hk : x.regs count = k) (ho : x.regs one = 1) (hfit : WordRAM.Fits w (4 * k + 4)) :
∃ (y : WordRAM.Data 96), WordRAM.ExecWithin w rootCode x y (5 * k.sqrt + 8) ∧ y.regs root = k.sqrt ∧ y.regs square = k.sqrt * k.sqrt ∧ y.mem = x.mem ∧ ∀ (i : Fin 96), i ≠ root → i ≠ square → i ≠ temporary → i ≠ limit → y.regs i = x.regs i

Compute the floor square root and its square by renaming NatSqrt.program and charging one final multiplication. The only intermediate bound is 4*k+4, which covers (sqrt k + 1)².