GCD and types
Types help to make it clear where the computation happens.
Let's first start with a few abbreviations.
fricas
(1) -> P(R,x)==>UnivariatePolynomial(x,R);
Type: Void
fricas
Z==>Integer;
Type: Void
fricas
Q==>Fraction Z;
Type: Void
Now we compute the gcd in
fricas
p11: P(P(Z, x), y) := 12*x^2*y;
fricas
p12: P(P(Z, x), y) := 18*x*y^2;
fricas
gcd(p11, p12)
Now in
fricas
p21: P(P(Q, x), y) := 12*x^2*y;
fricas
p22: P(P(Q, x), y) := 18*x*y^2;
fricas
gcd(p21, p22)
In
fricas
p31: P(Fraction P(Q, x), y) := 12*x^2*y;
fricas
p32: P(Fraction P(Q, x), y) := 18*x*y^2;
fricas
gcd(p31, p32)
And finally in the field
fricas
p41: Fraction P(P(Q, x), y) := 12*x^2*y;
fricas
p42: Fraction P(P(Q, x), y) := 18*x*y^2;
fricas
gcd(p41, p42)