hex

29.6. Performance🔗

Fixed-field arithmetic is polynomial arithmetic and scales as the degree suggests: multiplication is quadratic in the degree and inversion cubic with a logarithmic factor for coefficient growth. Everything that isolates roots is dominated by the isolation, so those rows are fixed inputs rather than asymptotics.

operation

input

time

PolyQuot multiplication

degree 16, dense coordinates

0.12 ms

PolyQuot inversion

degree 16, dense coordinates

0.71 ms

PolyQuot.approx

degree 128, fixed precision

17 ms

ZPoly.algebraicRoots

X⁴ − 10X² + 1, four roots

44 ms

AlgebraicRoot.exact

a root of ∏ (X² − p), p ≤ 13, degree 12

1.9 ms

AlgebraicRoot.exact

a root of X⁸ − 2 inside (X⁸ − 2)(X + 3)

310 ms

AlgebraicRoot.add

a root of X⁶ − 2 plus √3, degree product 12

4.5 s

AlgebraicPoly.roots

dense degree 6, one √2 coefficient

6.0 s

Medians on chungus2 from the exports recorded in reports/hex-number-field-performance.md in the hex-dev repository; regenerate with .lake/build/bin/hexnumberfield_bench run Hex.NumberFieldBench.<target>. The last three rows spend over ninety percent of their time in root isolation of the resultant or eliminant, and the X⁸ − 2 exactification spends its time re-isolating candidates rather than factoring.