Parent epic: #923
Depends on: Phase 5 (summation)
Goal
Round out the field operations. With addition and summation in place, the remaining algebraic operations are derived constructions.
Primitives
`negate(ZBCL x) -> ZBCL`: flip the sign on each block. Trivially preserves 0-overlap. (Section 4.2.4)
`mul(ZBCL x, ZBCL y) -> ZBCL`: distribute over co-lists using `twoMult` for partial products, gather with `sum`. (Section 4.2.5)
`div(ZBCL x, ZBCL y) -> ZBCL`: long-division-style refinement using `twoDiv`. (Section 4.2.6)
Acceptance criteria
`negate`, `mul`, `div` implemented per dissertation 4.2.4 / 4.2.5 / 4.2.6
Validity proofs sketched inline (value preservation + 0-overlap preservation)
Algebraic laws: `-(-x) = x`, `x * 1 = x`, `x / x = 1` (modulo zero), `x * y == y * x`, distributivity `x * (y + z) == (xy) + (x z)` -- all checked stream-wise to depth N
Edge cases: zero, signed zero, very small / very large operands, blocks with extreme `exp_offset`
Division by zero behaviour (under elreal's exception macro guard, consistent with existing types)
Tests parameterised over FpType in `{double, float, bfloat16}`
Tests live in `elastic/elreal/arithmetic/`
Out of scope
sqrt and transcendentals (Phase 7)
Optimised multiplication algorithms (Karatsuba etc.) -- defer
Reference
McCleeary 2019 dissertation, Sections 4.2.4 (negation), 4.2.5 (multiplication), 4.2.6 (division).
Parent epic: #923
Depends on: Phase 5 (summation)
Goal
Round out the field operations. With addition and summation in place, the remaining algebraic operations are derived constructions.
Primitives
Acceptance criteria
Out of scope
Reference
McCleeary 2019 dissertation, Sections 4.2.4 (negation), 4.2.5 (multiplication), 4.2.6 (division).