1Function: poldiscfactors
2Section: polynomials
3C-Name: poldiscfactors
4Prototype: GD0,L,
5Help: poldiscfactors(T,{flag=0}): [D, faD], where D = discriminant of the
6 polynomial T, and faD is a cheap partial factorization of D
7 (entries are coprime but need not be primes); if flag is 1, finish the
8 factorization via factorint.
9Doc: given a polynomial $T$ with integer coefficients, return
10 $[D, \var{faD}]$ where $D$ is the discriminant of $T$ and
11 \var{faD} is a cheap partial factorization of $|D|$: entries in its first
12 column are coprime and not perfect powers but need not be primes.
13 The factors are obtained by a combination of trial division, testing for
14 perfect powers, factorizations in coprimes, and computing Euclidean
15 remainder sequences for $(T,T')$ modulo composite factors $d$ of $D$
16 (which is likely to produce $0$-divisors in $\Z/d\Z$).
17 If \fl\ is $1$, finish the factorization using \kbd{factorint}.
18 \bprog
19 ? T = x^3 - 6021021*x^2 + 12072210077769*x - 8092423140177664432;
20 ? [D,faD] = poldiscfactors(T); print(faD); D
21 [3, 3; 7, 2; 373, 2; 500009, 2; 24639061, 2]
22 %2 = -27937108625866859018515540967767467
23
24 ? T = x^3 + 9*x^2 + 27*x - 125014250689643346789780229390526092263790263725;
25 ? [D,faD] = poldiscfactors(T); print(faD)
26 [2, 6; 3, 3; 125007125141751093502187, 4]
27 ? [D,faD] = poldiscfactors(T, 1); print(faD)
28 [2, 6; 3, 3; 500009, 12; 1000003, 4]
29 @eprog
30