vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.01k stars 120 forks source link

Very slow gcd #287

Open benruijl opened 6 years ago

benruijl commented 6 years ago

The following gcd is extremely slow:

S x1,...,x10;
L F = gcd_(32*x7^13*x8^19*x9*x10^7+56*x5^10*x6^6*x7*x8^22*x9-64*x4^2*x6*x7^6*x8^25*x9^5*x10-20*x4^9*x6*x7^16*x8*x9^5*x10^8-35*x4^9*x5^10*x6^7*x7^4*x8^4*x9^5*x10+40*x4^11*x6^2*x7^9*x8^7*x9^9*x10^2-4*x3^4*x5^5*x6*x7^13*x9^10*x10^7-7*x3^4*x5^15*x6^7*x7*x8^3*x9^10+8*x3^4*x4^2*x5^5*x6^2*x7^6*x8^6*x9^14*x10-16*x3^8*x5^12*x7^13*x10^7-28*x3^8*x5^22*x6^6*x7*x8^3+32*x3^8*x4^2*x5^12*x6*x7^6*x8^6*x9^4*x10-4*x2*x3*x4^6*x5^7*x7^13*x8^4*x10^8-7*x2*x3*x4^6*x5^17*x6^6*x7*x8^7*x10+8*x2*x3*x4^8*x5^7*x6*x7^6*x8^10*x9^4*x10^2+80*x2^2*x3^10*x7^7*x8^19*x9*x10-50*x2^2*x3^10*x4^9*x6*x7^10*x8*x9^5*x10^2-10*x2^2*x3^14*x5^5*x6*x7^7*x9^10*x10-40*x2^2*x3^18*x5^12*x7^7*x10+40*x2^3*x3^8*x6^2*x8^19*x9*x10^7-25*x2^3*x3^8*x4^9*x6^3*x7^3*x8*x9^5*x10^8-10*x2^3*x3^11*x4^6*x5^7*x7^7*x8^4*x10^2-5*x2^3*x3^12*x5^5*x6^3*x9^10*x10^7-20*x2^3*x3^16*x5^12*x6^2*x10^7-5*x2^4*x3^9*x4^6*x5^7*x6^2*x8^4*x10^8-8*x1*x3*x4^7*x5^9*x8^21*x9+5*x1*x3*x4^16*x5^9*x6*x7^3*x8^3*x9^5*x10+x1*x3^5*x4^7*x5^14*x6*x8^2*x9^10+4*x1*x3^9*x4^7*x5^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x8^19*x9-15*x1*x3^19*x4^9*x6*x7^3*x8*x9^5*x10-3*x1*x3^23*x5^5*x6*x9^10-12*x1*x3^27*x5^12-3*x1*x2*x3^20*x4^6*x5^7*x8^4*x10+6*x1*x2^5*x3^7*x4^5*x5^2*x6^2*x7*x8^10*x9*x10^6-6*x1*x2^9*x3^3*x4^4*x5^2*x6^3*x7^3*x8^13*x10^2-40*x1*x2^19*x8^19*x9+25*x1*x2^19*x4^9*x6*x7^3*x8*x9^5*x10+5*x1*x2^19*x3^4*x5^5*x6*x9^10+20*x1*x2^19*x3^8*x5^12+5*x1*x2^20*x3*x4^6*x5^7*x8^4*x10-3*x1^2*x2^5*x3^19*x4^4*x5^2*x6*x8^5*x10^2+5*x1^2*x2^24*x4^4*x5^2*x6*x8^5*x10^2-80*x1^3*x2^4*x3^13*x8^19*x9+50*x1^3*x2^4*x3^13*x4^9*x6*x7^3*x8*x9^5*x10+10*x1^3*x2^4*x3^17*x5^5*x6*x9^10+40*x1^3*x2^4*x3^21*x5^12+10*x1^3*x2^5*x3^14*x4^6*x5^7*x8^4*x10+10*x1^4*x2^9*x3^13*x4^4*x5^2*x6*x8^5*x10^2-24*x1^6*x3*x8^19*x9^14+15*x1^6*x3*x4^9*x6*x7^3*x8*x9^18*x10+3*x1^6*x3^5*x5^5*x6*x9^23+12*x1^6*x3^9*x5^12*x9^13+3*x1^6*x2*x3^2*x4^6*x5^7*x8^4*x9^13*x10+3*x1^7*x2^5*x3*x4^4*x5^2*x6*x8^5*x9^13*x10^2);
P;
.end
tueda commented 6 years ago

Ah, actually this example is just extremely slow:

Time =     131.64 sec    Generated terms =          6
               F         Terms in output =          6
                         Bytes used      =        364

   F =
      8*x8^19*x9 - 5*x4^9*x6*x7^3*x8*x9^5*x10 - x3^4*x5^5*x6*x9^10 - 4*x3^8*
      x5^12 - x2*x3*x4^6*x5^7*x8^4*x10 - x1*x2^5*x4^4*x5^2*x6*x8^5*x10^2;
$ ./run.py --nvars 10 --degree 20 --nterms 10 --coeffpow 1 --nwarmups 0 --nproblems 1 --aout --form --fermat --rings
a.out: 0.035s
FORM: 132.774s
Fermat: 0.580s
Rings: 0.163s

Unlucky case?

benruijl commented 6 years ago

It's only 10000 times as slow :)

I can have a look what's going on.