NLA-lib Explorer

NLAlib.Ops.IsDotTrace.abs_sum_mul_sub_le_of_absRelErr

Library · theorem

A dot trace with relative allowance u \ge 0 and absolute allowance \eta \ge 0 on each product and addition has error at most \bigl((1+u)^{2n}-1\bigr)\sum_{i<n}\lvert \mathbf{x}_i y_i\rvert \quad + n(1+u)^{2n}(2+u)\eta\,. No smallness assumption on nu is needed. This supports underflow-aware consumers of the actual kernel; it is not a no-overflow assertion. [Higham2002, §2.2 and §3.1].

NLAlib.Ops.IsDotTrace.abs_sum_mul_sub_le_of_absRelErr {u η : ℝ} (hu : 0 ≤ u) (hη : 0 ≤ η)
  {x y s : ℕ → ℝ} {n : ℕ} (h : Ops.IsDotTrace (Computation.AbsRelErr u η) x y n s) :
  |∑ k ∈ Finset.range n, x k * y k - s n| ≤
    ((1 + u) ^ (2 * n) - 1) * ∑ k ∈ Finset.range n, |x k * y k| +
      ↑n * (1 + u) ^ (2 * n) * (2 + u) * η

Full source on GitHub

Import NLAlib.Ops.Blas.DotMixed.