NLA-lib Explorer

NLAlib.rotateLeftWithScratch_writes

Library · theorem

Exact arithmetic

The actual left scalar rotation always terminates under the exact scalar model and stores the two mathematical Givens outputs. Input/output views are exactly aliased. [GolubVanLoan2013, §5.1.8]. Shared by the trees of NLAlib.ShiftedQR.deflationRoutine, NLAlib.hessenbergReduceLast, NLAlib.ShiftedQR.scalarDecouple, NLAlib.ShiftedQR.shiftedStepRoutine, NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.rotateLeftWithScratch_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] {M : Ops.Machine ℝ}
  {I : Ops.Interp Op Tst ℝ} (hI : Ops.IsScalar M I) (hM : Ops.ExactModel id M) {τ : Ops.Tape ℝ}
  {m : Ops.Mem ℝ} {c s x y t : ℕ × ℕ} {cv sv xv yv : ℂ} (htc : t.1 ≠ c.1) (hts : t.1 ≠ s.1)
  (htx : t.1 ≠ x.1) (hty : t.1 ≠ y.1)
  (hxy : Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 2) (Ops.Store.inBlock y.1 y.2 2))
  (hc0 : m.store.get c.1 c.2 = some cv.re) (hc1 : m.store.get c.1 (c.2 + 1) = some cv.im)
  (hs0 : m.store.get s.1 s.2 = some sv.re) (hs1 : m.store.get s.1 (s.2 + 1) = some sv.im)
  (hx0 : m.store.get x.1 x.2 = some xv.re) (hx1 : m.store.get x.1 (x.2 + 1) = some xv.im)
  (hy0 : m.store.get y.1 y.2 = some yv.re) (hy1 : m.store.get y.1 (y.2 + 1) = some yv.im)
  (ht : t.2 + 10 ≤ m.store.len t.1) (hx : x.2 + 2 ≤ m.store.len x.1)
  (hy : y.2 + 2 ≤ m.store.len y.1) :
  Ops.Writes Ops.Mode.total I τ rotateLeftWithScratch (Ops.Env.frame [] [c, s, x, y, t, x, y])
    (Ops.Fp.blocks [t, x, y] [10, 2, 2])
    (fun μ ↦
      μ.pos = m.pos ∧
        μ.readBlocks [x, y] [2, 2] =
          some
            [[(cv * xv + sv * yv).re, (cv * xv + sv * yv).im],
              [(-star sv * xv + star cv * yv).re, (-star sv * xv + star cv * yv).im]])
    m

Full source on GitHub

Import NLAlib.Matrix.FinitePrecision.GivensRotation.