TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Operations.Adjacent.Proof.Boundaries

Boundary behavior of adjacent-value operations #

These theorems describe nextUp and nextDown at NaNs, zeros, infinities, and saturating finite endpoints. They also extend the exact rank-step results from Adjacent.Proof.Core to one-sided rank inequalities that remain valid at fixed endpoints.

Exceptional values and boundaries #

On a NaN, nextUp returns the format's quietNaN result.

On a NaN, nextDown returns the format's quietNaN result.

Positive infinity is the fixed upper endpoint of nextUp.

Negative infinity is the fixed lower endpoint of nextDown.

Both signed zeros step upward to the least positive subnormal.

Both signed zeros step downward to the negative subnormal of least magnitude.

An unsigned-zero format steps directly from its negative subnormal of least magnitude to zero, skipping the reserved sign-mask NaN word.

A format without infinity saturates nextUp at its largest finite value.

A format without infinity saturates nextDown at its most negative finite value.

A represented positive infinity is fixed by nextUp.

A represented negative infinity is fixed by nextDown.

Rank inequalities including saturating endpoints #

For every non-NaN value, nextUp never decreases the adjacency rank.

Ordinary values advance exactly one rank. Positive infinity and the largest finite value of a format without infinity are fixed points, so the inequality becomes equality at those endpoints.

For every non-NaN value, nextDown never increases the adjacency rank.

Ordinary values retreat exactly one rank. Negative infinity and the most negative finite value of a format without infinity are fixed points, so the inequality becomes equality at those endpoints.