source: git/Tst/Short/gcd4test.tst @ 0f2fcb4

spielwiese
Last change on this file since 0f2fcb4 was 60cc12, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: added new tests for gcd from http://home.bway.net/lewis/fermat/gcdcomp and "Evaluation of the Heuristic Polynomial GCD"
  • Property mode set to 100644
File size: 590 bytes
Line 
1LIB "tst.lib";tst_init();
2proc test4 (int p)
3{
4  ring r= p, x(1..11), dp;
5  poly d= x(1)^2*x(2)^2 + 1;
6  poly f1= x(1)^2 - x(2)^2 - 1;
7  poly g1= x(1)*x(2) + 2;
8  poly f= d*f1;
9  poly g= d*g1^2;
10  poly testgcd= gcd (f,g);
11  testgcd= testgcd/leadcoef (testgcd);
12  testgcd == d;
13  int i;
14  for (i= 3; i <= 11; i++)
15  {
16    d= d + x(i)^2;
17    f1= f1 + x(i)^2;
18    g1= g1 + x(i);
19    f= f1*d;
20    g= d*g1^2;
21    testgcd= gcd (f,g);
22    testgcd= testgcd/leadcoef (testgcd);
23    testgcd == d;
24  }
25}
26
27test4 (3);
28tst_status();
29test4 (43051);
30tst_status();
31test4 (0);
32tst_status();
33tst_status(1);
34$
Note: See TracBrowser for help on using the repository browser.