NLA-lib Explorer

Arithmetic errors with an absolute allowance

Library · Source module

Arithmetic errors with an absolute allowance

NLAlib.Computation.AbsRelErr permits an absolute error in addition to relative error. The absolute allowance can describe gradual underflow in a finite-exponent format or the quantization error of fixed-point arithmetic. It is independent of the word representation, rounding rule, operation charge and storage width. The predicate is independent of any program interpretation.

The allowances can vary with the operation: IEEE addition and subtraction need no absolute underflow allowance, whereas multiplication and division do. A relative-only contract transfers to this relation, but its all-range success assumptions do not certify a finite-exponent backend. [Higham2002, §2.2].

Main results

* NLAlib.Computation.RelErr states relative error in the standard arithmetic model.

* NLAlib.Computation.RelErr.absRelErr: relative errors admit a nonnegative absolute allowance. * NLAlib.Computation.AbsRelErr.relErr: a zero absolute allowance recovers relative error. * NLAlib.Computation.AbsRelErr.abs_add_sub_le: multiplication-addition error composition. * NLAlib.Computation.AbsRelErr.abs_le_of_eq_zero: magnitude compatible with a computed zero.

Declarations