hex

30.5. Performance🔗

Coordinate arithmetic scales with the dimension D of the tower: addition is linear, multiplication quadratic, and inversion runs an extended gcd over the field below. The composite operations mix factoring, root isolation and adjoining, whose relative weights change with the degree, so they are recorded on fixed inputs rather than as asymptotics.

operation

input

time

adjoin?

2^{1/4} to ℚ(√2)

311 ms

adjoin?

√2 to ℚ(√2), already present

18 ms

factor?

X² − X − 1 over ℚ(√2, √3)

5.2 ms

factor?

X²⁴ − X − 1 over ℚ(√2)

9.2 ms

split?

(X² − 2)(X² − 3) over

60 ms

flatten?

ℚ(√2, √3)

21 ms

inversion

dimension 24, ℚ(3^{1/12}, √2)

7.0 ms

Per-call medians on chungus2 from the exports recorded in reports/hex-number-field-tower-performance.md in the hex-dev repository; regenerate with .lake/build/bin/hexnumberfieldtower_bench run Hex.NumberTowerBench.<target>. Factoring over a number field is far slower than PARI's nffactor on the same inputs (twenty-two to forty-six times on the Selmer family Xⁿ − X − 1 over ℚ(√2), at n = 2 and n = 12 respectively); the report records the comparison and its provenance.