Backward steps
Library · Source module
Backward steps
A contract of the operation core is a forward statement about one run: the output words are a function of the input words, up to a rounding error of each operation. Many algorithms are analysed instead backwards: each step returns the exact result of a slightly perturbed input, and the perturbations of the steps add. This file states that form once, for any notion of perturbation, so that an algorithm built from backward steps gets its backward error by composition, not by threading an error invariant through its proof by hand.
A backward-error relation (NLAlib.Ops.IsBackwardErrorRel) is a family of relations R_\varepsilon on states, with R_0 reflexive, R_{\varepsilon_1} followed by R_{\varepsilon_2} contained in R_{\varepsilon_1 + \varepsilon_2}, and R_\varepsilon increasing in \varepsilon. A perturbed unitary similarity is one (NLAlib.isBackwardErrorRel_isPerturbedUnitarySimilar).
A backward step (NLAlib.Ops.BackwardStep) is a block specification (NLAlib.Ops.Writes): from every memory that holds a state a (the predicate S), the run writes only the footprint and ends in a memory that holds a state \mathbf{b} (the predicate S') with R_\varepsilon(a, \mathbf{b}). The predicates S, S' carry everything a step needs and keeps besides the state: the parameter words, the capacity and separation of the views, structural facts such as a Hessenberg form. Exact arithmetic is \varepsilon = 0.
The rules compose backward steps with the statements of the program logic: a sequence adds the backward errors, a counted loop sums them over the rounds, a branch keeps the bound of its arms, the loop with early exit sums the rounds run and the continuation.
Main definitions
* NLAlib.Ops.IsBackwardErrorRel: a backward-error relation. * NLAlib.Ops.BackwardStep: a block specification with a backward error.
Main results
* NLAlib.Ops.BackwardStep.writes_add: a step after an accumulated backward error. * NLAlib.Ops.BackwardStep.skip, NLAlib.Ops.BackwardStep.of_exact: exact steps, error 0. * NLAlib.Ops.BackwardStep.mono: weakening. * NLAlib.Ops.BackwardStep.seq, NLAlib.Ops.BackwardStep.loop, NLAlib.Ops.BackwardStep.ite, NLAlib.Ops.BackwardStep.whileFuel: composition; a branch and the loop with early exit pass the outcome of the test to the arm that runs. * NLAlib.Ops.BackwardStep.loop_rel: a loop whose error per round is relative to a size of the state (geometric growth of the bound).
Declarations
- NLAlib.Ops.BackwardStep
- NLAlib.Ops.BackwardStep.ite
- NLAlib.Ops.BackwardStep.loop
- NLAlib.Ops.BackwardStep.loop_rel
- NLAlib.Ops.BackwardStep.mono
- NLAlib.Ops.BackwardStep.of_exact
- NLAlib.Ops.BackwardStep.seq
- NLAlib.Ops.BackwardStep.skip
- NLAlib.Ops.BackwardStep.whileFuel
- NLAlib.Ops.BackwardStep.writes_add
- NLAlib.Ops.IsBackwardErrorRel