Expand description
Complex BLAS — ComplexF64 with Fixed-Sequence Arithmetic.
§Design
Complex multiplication is lowered to a fixed-sequence of four multiplications and two additions, explicitly ordered to prevent cross-architecture FMA drift. This ensures bit-parity between x86 and ARM platforms.
Complex reductions (dot products, sums) feed real and imaginary parts separately into BinnedAccumulators for deterministic results.
§Fixed-Sequence Complex Multiply
(a + bi)(c + di) = (ac - bd) + (ad + bc)iThe four multiplications are computed first, then the two additions:
t1 = a * c (mul #1)
t2 = b * d (mul #2)
t3 = a * d (mul #3)
t4 = b * c (mul #4)
re = t1 - t2 (sub #1)
im = t3 + t4 (add #1)This explicit ordering prevents the compiler from fusing a*c - b*d
into an FMA (which would change the rounding behavior).
Structs§
- Complex
F64 - A complex number with f64 real and imaginary parts.
Functions§
- complex_
dot - Complex dot product using BinnedAccumulator for deterministic results.
- complex_
matmul - Complex matrix multiply: C[m,n] = A[m,k] × B[k,n] (fixed-sequence).
- complex_
sum - Complex sum using BinnedAccumulator for deterministic results.