Rounding from a Certified Bracket #
The effective calculation layer identifies a unit interval [m, m + 1) and a location inside it.
This file turns that finite location data into the integer selected by directed or nearest rounding
and proves agreement with the rounded-real definitions.
Unit-interval specialization of NeuralInbetween.
Instances For
Canonical location obtained from the floor bracket of a real value.
Instances For
Every real value satisfies its canonical floor bracket.
Increment an integer when the supplied decision is true.
Instances For
A conditional increment always selects one of the two bracket endpoints.
Upward rounding increments exactly when the location is inexact.
Instances For
Nearest rounding increments above the midpoint and delegates exact ties to chooseUp.
Instances For
Tie decision used by nearest-even rounding: increment exactly when the lower integer is odd.
Instances For
Choice-based nearest rounding with the parity decision is TorchLean's nearest-even mode.
A certified unit bracket determines floor exactly.
A certified unit bracket determines ceiling from exactness alone.
A certified unit bracket computes arbitrary-tie nearest rounding.
A certified unit bracket computes nearest-even rounding.
Mantissa truncation #
Mantissa, exponent, and location carried by an effective rounding calculation.
- mantissa : ℤ
Lower-endpoint mantissa.
- exponent : ℤ
Shared radix exponent.
- location : NeuralLocation
Input location within the represented unit interval.
Instances For
Instances For
Instances For
Real interval and location denoted by a truncation state.
Instances For
A positive value bracketed by a truncation state forces a nonnegative lower mantissa.
A positive bracket determines the canonical exponent from the lower mantissa's digit count. This is
the representation-level counterpart of Flocq's cexp_inbetween_float.
A bracket stored at the canonical exponent is a unit bracket for the scaled mantissa.
Discard shift low radix digits and transfer their information into the refined location.
Positive shifts are the intended use; correctness theorems state that premise explicitly.
Instances For
A positive shift produces a radix power strictly larger than one.
The truncated remainder is a valid cell index in the discarded radix block.
Mantissa reconstruction after one truncation step.
One positive truncation step preserves the represented real bracket and its refined location.
Number of low radix digits discarded to reach the exponent selected by fexp.
Instances For
Truncate only when the target exponent lies strictly above the stored exponent.
Instances For
Format-driven truncation preserves the represented real bracket.
For a positive input with sufficient initial precision, truncation both preserves the bracket and selects the canonical format exponent.
Nearest-even result selected from a format-truncated bracket.
Instances For
Truncation never changes a zero mantissa into a nonzero one.
Canonical mantissa/exponent representation produced by a rounding mode.
Instances For
If a finite decision procedure computes the rounded scaled mantissa, neuralRound is exactly the
real value of the corresponding mantissa/exponent pair.
A scaled-mantissa bracket computes format-level downward rounding.
A scaled-mantissa bracket computes format-level upward rounding.
A scaled-mantissa bracket computes format-level nearest-even rounding.
Canonical mantissa selected by effective nearest-even rounding.
Instances For
Every nearest-even format rounding has a canonical computed mantissa/exponent representation.
Nearest-even selection after canonical truncation agrees with generic rounded-real semantics.