Round to Odd #
For an inexact real input, oddRound selects the odd member of the two adjacent integers.
Exact integers are unchanged. Applied to a binary scaled mantissa, this is the usual round-to-odd
or jamming rule: discarded information is recorded by setting the least-significant retained bit.
The double-rounding result below concerns a fixed binary grid. The corresponding theorem for floating-point formats also needs hypotheses relating their precision and minimum exponents.
References:
- S. Boldo and G. Melquiond, “Emulation of a FMA and Correctly Rounded Sums: Proved Algorithms Using Rounding to Odd,” IEEE Transactions on Computers 57(4), 2008, pp. 462–471, §III-C, Theorem 3, DOI: 10.1109/TC.2007.70819. Author manuscript: https://guillaume.melquiond.fr/doc/08-tc.pdf.
- Flocq 4.2.2,
src/Prop/Round_odd.v, definitionsZrnd_odd,Rnd_odd_pt, and the format-level theoremround_N_odd: https://flocq.gitlabpages.inria.fr/releases/flocq-4.2.2.tar.gz.
Preserve integers; otherwise select the odd integer among floor x and floor x + 1.
Instances For
Exact integers are fixed by round-to-odd.
Round-to-odd is monotone and fixes every integer.
Round-to-odd with at least two extra binary digits prevents nearest-even double rounding on the
integer grid. roundAtScale_nearestEven_after_odd_binary_extra transports this to any fixed grid;
no floating-point (exponent-dependent) version is proved in this library.
Round-to-odd on a finer binary grid prevents nearest-even double rounding on a coarser grid.
The coarse grid has positive spacing step; the intermediate grid is finer by extra + 2 binary
digits. Both grids are fixed, so the theorem applies to fixed-point and affine-quantization grids.
It does not cover floating-point formats, whose spacing depends on the exponent of the value.
If x is not representable, round-to-odd selects an odd scaled integer mantissa.
Round-to-odd produces a value in the selected generic format.
Semantic round-to-odd specification at the grid exponent selected for the input.
An exact input is unchanged. An inexact result is a directed neighbor whose integer mantissa
is odd at exponent. Fixing this exponent matters: every nonzero binary dyadic has an odd
mantissa at some exponent, which alone would not characterize round-to-odd.
Instances For
Generic rounding with oddRound satisfies the round-to-odd point specification.
Flocq's round-to-odd point predicate, testing parity at the result's canonical exponent. Abrupt-underflow grids can give a different exponent to the input and output, so input-grid parity alone does not establish this predicate.
Instances For
Input-grid rounding satisfies canonical round-to-odd whenever the canonical exponent is preserved. Fixed-point grids always satisfy this condition.
Fixed-point round-to-odd meets Flocq's canonical parity convention for every input.