Correctness of sums and dot products #
Finite operands accumulate exactly as dyadics and undergo one final rounding. Semantics
defines the rational list and array-slice specifications; Internal proves that the accumulator
preserves them. The final theorems connect these invariants to sumWithStatus and dotWithStatus.
The zero-result theorems preserve the signed-zero rules. The real-valued rounding theorems require a finite output, since overflow to infinity has no real denotation. Permutation invariance applies to the finite accumulator; NaN selection can depend on traversal order.
Nonempty sums of same-sign zeros preserve that sign in every rounding mode. Generated invalid indicators survive later dot-product terms, including NaNs. Infinite singleton sums agree with casts, including the destination's conversion status.
Exact rational contribution to the accumulator; exceptional encodings contribute zero.
Instances For
Exact sum of the finite contributions.
Instances For
Exact sum of pairwise products, with an explicit error for unequal lengths.
Instances For
Exact dot product of remaining pairs from index, with bounds for both arrays.
Instances For
The bounded Array specification is the corresponding list dot product over the same slice.
This bridge lets the kernel traverse indexed arrays while public theorems use ordinary
list operations. The bounds ensure that drop and take select exactly remaining pairs.
On equal-sized arrays, the list and bounded-Array dot specifications agree exactly.
The finite-sum specification is independent of traversal order.
A one-pair finite dot product is exactly the product of the two contributions.
Finite-only accumulator states contain no exceptional value or generated invalid operation.
The finite sum proofs use this predicate to discharge every exceptional branch in State.finish
at once.
Instances For
The empty reduction state contains only finite terms.
Adding an exact dyadic preserves the finite-only state invariant.
A finite encoded value takes exactly the pushExact branch.
Consuming a finite encoded value preserves the finite-only state invariant.
A finite pair takes exactly the exact-product branch.
Consuming two finite factors preserves the finite-only state invariant.
Folding a list of finite values preserves the finite-only state invariant.
Recording a NaN leaves the exact finite accumulator unchanged.
Recording a NaN preserves an invalid operation generated by an earlier product.
Recording an infinity leaves the exact finite accumulator unchanged.
Every subsequent product preserves a previously generated invalid operation.
Generated invalid operations and opposing infinities raise invalid even in the NaN branches.
An arbitrary dot-product suffix cannot clear an invalid operation generated by its prefix.
Consuming one value changes the exact field by precisely its finite rational contribution.
Folding values accumulates exactly the rational sum of their finite contributions.
The Array summation kernel accumulates the exact rational finite sum.
Consuming one product adds exactly the product of its two finite rational contributions.
The indexed dot loop accumulates exactly the rational product sum of its Array slice.
Finite input pairs keep the indexed dot loop free of exceptional state.
The complete finite dot kernel accumulates exactly its rational Array specification.
The complete finite dot kernel cannot produce exceptional accumulator state.
The executable sum accumulator has the same exact rational value after any permutation.
This theorem concerns the finite accumulator field, not the complete exceptional result. NaN selection deliberately remains traversal-order dependent.
A mathematically nonzero finite sum gives a nonzero exact accumulator.
This keeps callers in the rational specification and hides the dyadic accumulator's internal representation.
A mathematically nonzero finite dot product gives a nonzero exact accumulator.
The premise uses the public list specification; equal array lengths rule out the error branch.
A nonzero sum of finite inputs performs one final dyadic rounding and reports exactly that rounding's status.
For finite inputs with a nonzero exact sum, the executable nearest-even reduction is the exact mathematical sum followed by one destination-format rounding.
The result-finiteness premise excludes overflow to infinity, whose encoding has no real denotation. Exact accumulation itself is established independently of this premise.
A finite sum whose exact accumulator is zero returns the specified signed zero and raises no status indicator.
A nonempty sum of zeros with one common sign preserves that sign in every rounding mode.
The destination's zero constructor accounts for formats without a negative zero. The hypotheses refer only to the input values, independently of the accumulator's signed-zero flags.
A singleton infinity has exactly the value and exception indicators of a destination cast.
A nonzero dot product of finite inputs performs one final dyadic rounding and reports exactly that rounding's status.
For finite equal-sized inputs with a nonzero exact dot product, the executable nearest-even reduction is the mathematical list dot product followed by one destination-format rounding.
outcome names the successful result of the Except-valued API. Its finiteness premise excludes
overflow to infinity, whose encoding has no real denotation.
A finite dot product whose exact accumulator is zero returns the specified signed zero and raises no status indicator.
The empty correctly rounded sum is positive zero with no exception indicator.
A mismatched dot product reports both observed lengths and performs no reduction.
The empty correctly rounded dot product is positive zero with no exception indicator.