Correctness of finite arithmetic #
The arithmetic layer decodes represented inputs to exact dyadics, performs one exact operation,
and quantizes once under the selected output policy. These theorems expose that contract through
the family-independent NumericalSystem and Operation interfaces.
Subtraction needs one format-specific convention. IEEE, OCP E4M3, FP4, and FP6 retain signed zero, so negation toggles the sign of zero. FNUZ has only one zero encoding, so its exact semantic negation canonicalizes zero to positive zero.
Complete denotation produced by quantizing one exact dyadic.
Instances For
Complete denotation produced by quantizing one exact rational magnitude.
Instances For
Denotation of the quantized exact quotient, or undefined for a zero divisor.
Instances For
Negation refines format-aware exact dyadic negation on every represented finite input.
Finite addition performs exact dyadic addition followed by one quantization.
Finite subtraction performs exact format-aware negation and addition, then quantizes once.
Finite multiplication performs an exact dyadic product followed by one quantization.
Finite fused multiply-add has one quantization after the exact product and sum.
Mixed-format multiply-add decodes storage operands and quantizes once into the accumulator.
Finite division refines exact rational division whenever the divisor is nonzero.
Finite casts decode exactly and quantize once into the destination format.