NLA-lib Explorer

NLAlib.Krylov.CG.residualCache_wp_float64

Library · theorem

Actual finite binary64 arithmetic writes the residual cache under an input-only largest-finite-result bound. The model supplies gradual-underflow accuracy itself. An end statement in operand form: no other declaration of the library is proved from it.

NLAlib.Krylov.CG.residualCache_wp_float64 {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.Blas1Op Op] [Ops.Apart Ops.Blas1Op Ops.ScalarOp Op]
  {I : Ops.Interp Op Tst Computation.FiniteFloat} (hI : Ops.IsScalar Ops.Float64.machine I)
  {τ : Ops.Tape Computation.FiniteFloat} {n : ℕ} {r z : ℕ × ℕ} {m : Ops.Mem Computation.FiniteFloat}
  {rs : List Computation.FiniteFloat} (hl : m.Live [r, z])
  (hr : m.store.readBlock r.1 r.2 n = some rs) (hz : z.2 < m.store.len z.1)
  (hRange :
    (1 + Float.Model.Format.binary64.unitRoundoff) ^ (2 * n) *
          ‖WithLp.toLp 2 (Ops.decv Ops.Float64.decode n rs)‖ ^ 2 +
        ↑n * (1 + Float.Model.Format.binary64.unitRoundoff) ^ (2 * n) *
            (2 + Float.Model.Format.binary64.unitRoundoff) *
          Float.Model.Format.binary64.underflowBound ≤
      Float.Model.Format.binary64.maxFinite) :
  Ops.Wp Ops.Mode.total I τ (Ops.Stmt.link Ops.Blas.sumSeqTable Ops.dotSum)
    (Ops.Env.frame [n] [r, r, z])
    (fun out ↦
      ∃ cache,
        out = m.upd z cache ∧
          out.store.get z.1 z.2 = some cache ∧
            Computation.AbsRelErr ((1 + Float.Model.Format.binary64.unitRoundoff) ^ (2 * n) - 1)
              (↑n * (1 + Float.Model.Format.binary64.unitRoundoff) ^ (2 * n) *
                  (2 + Float.Model.Format.binary64.unitRoundoff) *
                Float.Model.Format.binary64.underflowBound)
              (‖WithLp.toLp 2 (Ops.decv Ops.Float64.decode n rs)‖ ^ 2) (Ops.Float64.decode cache))
    m

Full source on GitHub

Import NLAlib.Krylov.CG.ResidualCacheFormats.