GCD with algebraic number coefficients
Define the answer and the cofacters.
> alias(a=RootOf(z^3-11*z-13,z));
> p1 := randpoly([a,x],degree=2);
> p2 := randpoly([a,x],degree=2);
> p3 := randpoly([a,x],degree=2);
Multiply the answer by a cofactor to create and input polynomial.
> p12 := evala(Expand(p1*p2));
> p13 := evala(Expand(p1*p3));
Measure the time (in seconds) to calculate the greatest common divisor .
> st := time(): g := evala(Gcd(p12,p13)): time()-st;
> g;
Check the result.
> ans := p1/lcoeff(p1,x);
> zero_4 := ans-g;