NLA-lib Explorer

A floating-point machine with black-box matrix multiplication and QR

Library · Source module

A floating-point machine with black-box matrix multiplication and QR

Fast dense algorithms are analysed against black-box primitives with normwise guarantees, not against an implementation ([DemmelDumitriuHoltzKleinberg2007]; [DemmelDumitriuHoltz2007]; [Shah2024, Section 1.3]). This file fixes what an algorithm may do with data: NLAlib.FloatMachine F Su Sg bundles every operation on stored numbers of an abstract type F (rounded +, -, \times, /, exact negation, exact comparison, rounded conversion of a natural number, exact conversion to a natural number by the floor, the constants 0 and 1), the matrix-multiplication and QR black boxes on matrices of stored complex numbers F × F (real and imaginary parts, as IEEE arithmetic stores them), and the two samplers, from ideal samples of abstract types Su, Sg to stored numbers. An algorithm written generically over F, Su and Sg touches data only through the machine: F has no arithmetic instance, so exact arithmetic on computed values does not typecheck (design note docs/design/Eigensolvers-HermitianDiagonalization.md, §2.0).

The analysis decodes stored numbers by dec : F → ℝ and states the machine's contract NLAlib.FloatMachine.IsAccurate: each scalar operation returns a rounding of its exact result on the decoded operands, one rounding per operation (NLAlib.IsRoundingOf: relative error u above the floor \tau, in the range \Omega), negation, comparisons, the floor conversion, 0 and 1 are exact, and the black boxes and samplers satisfy the normwise contracts NLAlib.IsMatMulErr, NLAlib.IsQRErr, NLAlib.IsUnifSampler, NLAlib.IsNormalSampler through the decoding. The floor \tau and range \Omega are 0 and arbitrary with an unbounded exponent; a bounded-exponent machine satisfies the contract with \tau > 0 (§12 of the note).

Main definitions

* NLAlib.MatMulMap, NLAlib.QRMap: the types of the routines on a type of stored entries. * NLAlib.IsRoundingOf: z is a rounding of a. * NLAlib.IsMatMulErr, NLAlib.IsQRErr, NLAlib.IsUnifSampler, NLAlib.IsNormalSampler. * NLAlib.FloatMachine, NLAlib.decodeComplex, NLAlib.decodeMatrix, NLAlib.FloatMachine.IsArithAccurate, NLAlib.FloatMachine.IsAccurate.

Main results

* NLAlib.exists_floatMachine_isAccurate: the exact machine. * NLAlib.exists_floatMachine_isAccurate_binaryFloatRound: a bounded-format machine. * NLAlib.IsMatMulErr.of_specNorm_mul_sub_le_add: from a mixed bound to the floor form.

Declarations