LAProof.accuracy_proofs.gemv_acc

Matrix-Vector Multiplication Error Bounds

This file establishes mixed and forward error bounds for floating-point matrix-vector multiplication, building on the dot product and summation accuracy results.

Error Factors

Throughout, the accumulated relative error factor is \(g(n) = (1 + \mathbf{u})^n - 1\) and the mixed absolute error factor is \(g_1(n_1, n_2) = n_1 \cdot \eta \cdot (1 + g(n_2))\), where \(\mathbf{u}\) is the unit roundoff and \(\eta\) is the underflow threshold for the given type. Both are defined in common.

Main Results

  • vec_vec_mul_mixed_error: Shows that the floating-point row-times-column dot product can be expressed as an exact product of a componentwise-perturbed row vector with the exact column vector, plus a small absolute residual.
  • mat_vec_mul_mixed_error: Shows that the floating-point matrix-vector product can be expressed as an exact product of a componentwise-perturbed matrix with the exact input vector, plus a small absolute residual. Proved by applying vec_vec_mul_mixed_error row by row.
  • mat_vec_mul_forward_error: Bounds the absolute forward error of the floating-point matrix-vector product in the vector max-norm by \(g(n) \cdot \|A\| \cdot \|B\| + g_1(n,n)\), where \(\|A\|\) is the matrix infinity norm and \(\|B\|\) is the vector max-norm.

Dependencies

This file relies on:
  • preamble, common: basic setup and shared definitions
  • dotprod_model, sum_model: relational models of dot product and summation
  • dot_acc, float_acc_lems: accuracy lemmas
  • mv_mathcomp: floating-point matrix/vector operations and norm definitions

From LAProof.accuracy_proofs Require Import preamble common
                                             dotprod_model sum_model
                                             dot_acc float_acc_lems mv_mathcomp.

From mathcomp.algebra_tactics Require Import ring.

Section WithNAN.

Context {NAN : FPCore.Nans} {t : type}.

Notation g := (@common.g t).
Notation g1 := (@common.g1 t).

Row-Vector Times Column-Vector: Mixed Error Bound

vec_vec_mul_mixed_error shows that the floating-point row-times-column dot product can be expressed as an exact product of a componentwise-perturbed row vector with the exact column vector, plus a small absolute residual.

Lemma vec_vec_mul_mixed_error :
   [n] (A : 'M[ftype t]_(1,n)) (B : 'M[ftype t]_(n,1))
    (Hfin : F.finitemx (F.mulmx A B)),
   (E : 'M[R]_(1,n)) (eta : 'M[R]_(1,1)),
      map_mx FT2R (F.mulmx A B)
        = ((map_mx FT2R A + E) ×m (map_mx FT2R B) + eta)%Ri
     ( i j, Rabs (E i j) g n × Rabs (map_mx FT2R A i j))
     ( i j, Rabs (eta i j) g1 n n).

General Matrix-Vector Product: Mixed Error Bound

mat_vec_mul_mixed_error shows that the floating-point matrix-vector product can be expressed as an exact product of a componentwise-perturbed matrix with the exact input vector, plus a small absolute residual. Proved by applying vec_vec_mul_mixed_error row by row.

Lemma mat_vec_mul_mixed_error :
   [m n] (A : 'M[ftype t]_(m,n)) (B : 'M[ftype t]_(n,1))
    (Hfin : F.finitemx (F.mulmx A B)),
   (E : 'M[R]_(m,n)) (eta : 'M[R]_(m,1)),
      map_mx FT2R (F.mulmx A B)
        = ((map_mx FT2R A + E) ×m (map_mx FT2R B) + eta)%Ri
     ( i j, Rabs (E i j) g n × Rabs (map_mx FT2R A i j))
     ( i j, Rabs (eta i j) g1 n n).

Matrix-Vector Product: Forward Error Bound

mat_vec_mul_forward_error bounds the absolute forward error of the floating-point matrix-vector product in the vector max-norm by \(g(n) \cdot \|A\|_M \cdot \|B\| + g_1(n,n)\), where normM is the matrix infinity norm and normv is the vector max-norm.

Theorem mat_vec_mul_forward_error :
   [m n] (A : 'M[ftype t]_(m,n)) (B : 'M[ftype t]_(n,1))
    (Hfin : F.finitemx (F.mulmx A B)),
    normv (map_mx FT2R (F.mulmx A B) - (map_mx FT2R A ×m map_mx FT2R B))
       (g n × normM (map_mx FT2R A) × normv (map_mx FT2R B)) + g1 n n.

End WithNAN.