92. Unify factor_big into factor in std.math (2026-11-21)
- Decision. Remove
factor_big(x)fromstd.math;factor(x: Int)handles every 64-bitInt >= 1using trial division forx <= 1_000_000(O(sqrt x)) and trial division below 100 + deterministic Miller-Rabin + Pollard's rho above (O(x^(1/4) log x)expected).Sieve(n).factor(x)remains theO(log x)bulk-query path. - Why.
factor_bigbesidefactorwas a width twin violating one-spelling-per-job. A single threshold branch at1_000_000keeps small inputs as fast as plain trial division while preventingO(sqrt x)TLE on 64-bit inputs (includingphi(x)). Zero corpus ports calledfactor_big. - Evidence.
cf2201eemitted C++ grew by only +82 B (35,974 -> 36,056 B);cf2147gis20,364 B(32% of 64 KB cap); all 19 tests instdlib/math.cpandexamples/local-lib/math/primes.cppass across1..2000, random1..1e12, and 64-bit semiprimes/primes. - Reverse. Restore
pub fn factor_big(x: Int)instdlib/math.cpand revertfactor(x)to trial division only.