Below is the Magma code used to run the benchmarks in Section 5 of the paper "In-place Arithmetic for Univariate Polynomials over an Algebraic Number Field" by Mahdi Javadi and Michael Monagan. First, in Maple, we generate the minimal polynomials m1(z1) and m2(z1,z2) with degrees d1 and d2 in z1 and z2 respectively. These have to be irreducible modulo p. That is, m1 is irreducible in Zp[z1] and m2 is irreducible in R1[z2] where R1 = Zp[z1]/. The reason we need m1 and m2 irreducible is because Magma's Gcd command requires that R2 = R1[z2]/ is a field. To create m1 and m2 for the case d1 = 3 and d2 = 20 respectively, we use the following Maple code. d1 := 3; d2 := 20; p := 3037000453; m1 := Randprime(d1, z1) mod p: alias(alpha1 = RootOf(m1, z1)): m2 := Randprime(d2, z2, alpha1) mod p: fd := fopen("m1.dat", WRITE); fprintf(fd,"dm1 := %d;\ndm2 := %d;\nm1 := %a;\n", d1, d2, m1); fclose(fd); fd := fopen("m2.dat", WRITE); fprintf(fd,"m2 := %a;\n", m2); fclose(fd); This code will generate two files m1.dat and m2.dat which include the two minimal polynomials m1 and m2. These files will be loaded by the following Magma code. p := 3037000453; Zp := FiniteField(p); gen_Zp := function() return Random(Zp); end function; Zp := PolynomialRing(Zp); load "m1.dat"; R1 := quo; F1 := PolynomialRing(R1); gen_alpha1 := function() return &+[gen_Zp()*alpha1^i : i in [0..dm1 - 1]]; end function; load "m2.dat"; R2 := quo; F := PolynomialRing(R2); Now we create the input polynomials a, b, g in F, of degree d = 40 then d = 80 and time multiplication, Gcd and division with remainder as follows: gen_coeff := function() return &+[gen_alpha1()*alpha2^i : i in [0..dm2 - 1]]; end function; gen_poly := function(d) return &+[gen_coeff()*x^i: i in [0..d]]; end function; for d in [40,80] do a := gen_poly(d); b := gen_poly(d); g := gen_poly(d); t1 := Cputime(); for i in [1..20] do f1 := a*g; f2 := b*g; h1 := Hash(f1); h2 := Hash(f2); end for; tmul := Cputime(t1); tmul := tmul / 20.0; t2 := Cputime(); g := Gcd(f1,f2); h := Hash(g); tgcd := Cputime(t2); t3 := Cputime(); r := f1 mod g; r:= Hash(r); trem := Cputime(t3); printf "MAG_MUL = %o\t\t MAG_REM = %o\t\t MAG_GCD = %o\n",tmul,trem,tgcd; end for; Remark: In Magma, one can also create the ring Zp of integers modulo p using Zp := ResidueClassRing(p); instead of Zp := FiniteField(p); We observed that all Magma timings are about twice as slow if one uses Zp := ResidueClassRing(p);