Nearest Rounding with a Tie Choice #
neuralNearestChoice chooseUp rounds to a nearest integer. At an exact midpoint, chooseUp f
decides whether the lower integer f or the upper integer f + 1 is selected. This is the native
Lean counterpart of Flocq's Znearest choice.
Choice-based nearest rounding always selects floor or ceiling.
Choice-based nearest rounding lies between floor and floor plus one.
@[simp]
Choice-based nearest rounding fixes integers.
Every tie choice has absolute error at most one half.
Choice-based nearest rounding is monotone.
instance
TorchLean.Floats.neuralNearestChoiceValid
(chooseUp : ℤ → Bool)
:
NeuralValidRndToNearest (neuralNearestChoice chooseUp)
Every tie-choice nearest mode is a valid nearest rounding mode.