NF Sum Reduction Bounds #
Forward-error bounds for rounded sum reductions. The accumulator carries both the runtime value and a proof budget, so every addition contributes the incoming element error plus one rounding term.
One fold step for sum_spec that tracks an explicit forward error budget.
State is (accR, epsAcc) where accR is the runtime accumulator and epsAcc bounds the absolute
error |toSpec accR - accS| for the corresponding spec accumulator accS. Each step adds:
- the incoming per-element budget
epsElem; - one rounding-ULP term for the addition.
Instances For
Fold sum_step over a tensor via tensor_foldl_spec.
This is the shared helper behind sum_bound and approxT_sum_spec: it simultaneously computes the
runtime sum (in .1) and the accumulated error bound (in .2).
Instances For
Forward absolute-error bound for sum_spec.
sum_bound epsElem tR is the .2 component of sum_fold_state started at 0, assuming each element
is approximated within epsElem. This corresponds to naive sequential summation with a rounding
term added at each step (cf. standard floating-point summation analyses).
Instances For
Forward approximation bound for sum_spec over an arbitrary tensor shape.
If xR approximates xS elementwise within eps, then the scalar sums sum_spec xR and
sum_spec xS differ by at most sum_bound eps xR.