NLA-lib Explorer

NLAlib.Ops.Examples.runs_bilinear_link_pairwise

Library · theorem

Standard rounding Oracle: matrix–vector product

Pairwise summation of depth k gives error (1 + u) ^ (clog 2 m + 1) - 1, one matrix-vector call, m multiplications, and the scalar count Blas.pairCount m, using 2 m + 2 clog 2 m scratch cells.

NLAlib.Ops.Examples.runs_bilinear_link_pairwise {K Op Tst : Type} [Ops.Has Ops.OperatorOp Op]
  [Ops.Has Ops.Blas1Op Op] [Inhabited K] [Ops.Has Ops.ScalarOp Op]
  [Ops.Apart Ops.Blas1Op Ops.ScalarOp Op] [Ops.Apart Ops.Blas1Op Ops.OperatorOp Op]
  {M : Ops.Machine K} {u : ℝ} {dec : K → ℝ} (hM : Ops.StdModel u dec M) (hu : 0 ≤ u)
  {I : Ops.Interp Op Tst K} (hI : Ops.IsScalar M I) {k m n : ℕ} (hk : Nat.clog 2 m < k)
  {A : Matrix (Fin m) (Fin n) ℝ} (hA : Ops.IsExactMatvec dec A I) {τ : Ops.Tape K} {x y z : ℕ × ℕ}
  {μ : Ops.Mem K} {xs ys : List K} (hxz : x.1 ≠ z.1) (hyz : y.1 ≠ z.1) (hl : μ.Live [x, y, z])
  (hx : μ.store.readBlock x.1 x.2 m = some xs) (hy : μ.store.readBlock y.1 y.2 n = some ys)
  (hz : z.2 < μ.store.len z.1) :
  Ops.ConditionalRuns I (Ops.Blas.ws Ops.Blas.pairWs) τ
    (Ops.Stmt.link (Ops.Blas.pairwise k).table Ops.Examples.bilinear)
    (Ops.Env.frame [m, n] [x, y, z]) μ
    (Ops.Count.one (Ops.Has.inj Ops.OperatorOp.matvec) [m, n] +
      (m • Ops.Blas.sc Ops.ScalarOp.mul + Ops.Blas.pairCount m))
    (2 * m + 2 * Nat.clog 2 m)
    (Ops.Examples.BilinearRounded dec A ((1 + u) ^ (Nat.clog 2 m + 1) - 1) z xs ys μ)

Full source on GitHub

Import NLAlib.Ops.Examples.Bilinear.