GCD with algebraic number coefficients

Define the answer and the cofacters.

> alias(a=RootOf(z^3-11*z-13,z));

[Maple Math]

> p1 := randpoly([a,x],degree=2);

[Maple Math]

> p2 := randpoly([a,x],degree=2);

[Maple Math]

> p3 := randpoly([a,x],degree=2);

[Maple Math]

Multiply the answer by a cofactor to create and input polynomial.

> p12 := evala(Expand(p1*p2));

[Maple Math]
[Maple Math]

> p13 := evala(Expand(p1*p3));

[Maple Math]
[Maple Math]

Measure the time (in seconds) to calculate the greatest common divisor .

> st := time(): g := evala(Gcd(p12,p13)): time()-st;

[Maple Math]

> g;

[Maple Math]

Check the result.

> ans := p1/lcoeff(p1,x);

[Maple Math]

> zero_4 := ans-g;

[Maple Math]