Flocq-style formats (FIX / FLX / FLT) #
Exponent-selection functions fexp : ℤ → ℤ describe three real-valued format families:
FIXis a fixed-exponent grid;FLXhas fixed precision and unbounded exponents;FLThas fixed precision, a lower exponent bound, and gradual underflow.
FLT has no upper exponent bound or overflow. Executable binary formats with infinities,
NaNs, and signed zeros are defined in FloatLib/Floats/Formats/BinaryInterchange/.
References:
- Flocq project: https://flocq.gitlabpages.inria.fr/flocq/
- S. Boldo, G. Melquiond, “Flocq: a unified Coq library for proving floating-point algorithms correct” (ARITH 2011), DOI: 10.1109/ARITH.2011.40
- IEEE Standard for Floating-Point Arithmetic (IEEE 754-2019)
A positive number of radix digits for FLX, FLT, and FTZ formats.
Raw exponent functions remain available for algebraic proofs, but callers accepting an integer
configuration should first use FormatPrecision.ofInt?. This prevents a zero or negative
precision from being silently reinterpreted through an absolute-value conversion.
This is Mathlib's proof-erased positive-natural carrier rather than another project-local structure.
Instances For
Convert a proof-carrying format precision to the integer parameter used by exponent formulas.
Instances For
Check a natural-number precision at a configuration boundary.
Instances For
Check an integer precision, rejecting zero and every negative value.
Instances For
A checked precision remains positive after conversion to the integer exponent parameter.
fixExp emin is the simplest exponent-selection function: it always returns the same exponent.
This is Flocq's FIX_exp. It describes values living on a single fixed grid
$\beta^{\mathtt{emin}}\mathbb{Z}$, as in fixed-point arithmetic or quantization.
Instances For
The ULP at zero for a fixed-point grid is its fixed grid step.
FIXFormat emin x says that x is exactly representable on the fixed grid with exponent emin.
The predicate is phrased through an existential FloatRep β so that it composes with the rest of
the rounding model (toReal, ULP bounds and so on).
Instances For
flxExp prec is the unbounded-exponent family.
This is Flocq's FLX_exp: a floating-point format with no exponent bounds and mantissa precision
prec. It is a convenient intermediate model for proofs because it removes the underflow and
overflow corner cases while still tracking mantissa rounding.
Instances For
The unbounded exponent selector associated with a checked precision.
Instances For
A checked precision automatically discharges the FLX exponent-validity obligation.
The FLX exponent selector is monotone for every precision parameter.
Instances For
The FLX exponent selector has bounded one-step growth.
Instances For
Exact representability predicate for FLX.
The precision is positive, and $x=m\beta^e$ for an integer mantissa satisfying $|m|<\beta^{\mathtt{prec}}$.
Instances For
Nonpositive precision is rejected by the explicit FLX format predicate.
The unbounded FLX exponent function has no negligible exponent.
Consequently, the generic ULP of zero is zero for FLX.
fltExp emin prec is the lower-exponent-bounded family with gradual underflow.
This is Flocq's FLT_exp. The exponent is bounded below by emin but has no upper bound, so the
format models gradual underflow but not overflow, infinities, or NaNs. Gradual underflow is
captured by taking max (e - prec) emin.
Instances For
fltExp emin prec satisfies ValidExp for positive precision.
This validity witness connects proofs to an executable binary descriptor through
BinaryInterchange.Model.fexpOf and BinaryInterchange.Model.roundAt.
Instances For
The gradual-underflow exponent selector associated with a checked precision.
Instances For
A checked precision automatically discharges the gradual-underflow validity obligation.
The gradual-underflow FLT exponent selector has bounded one-step growth.
Instances For
The gradual-underflow FLT exponent selector is monotone.
Instances For
Exact representability predicate for FLT.
The precision is positive, and $x=m\beta^e$ with $|m|<\beta^{\mathtt{prec}}$ and $\mathtt{emin}\le e$. In particular, every nonzero value has magnitude at least $\beta^{\mathtt{emin}}$.
Instances For
Nonpositive precision is rejected by the explicit FLT format predicate.
FLT has a negligible-exponent witness at emin.
The ULP at zero for FLT is the smallest grid step $\beta^{\mathtt{emin}}$.