fieker-DuValspielwiese
Last change
on this file since 051432 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:
743 bytes
|
Line | |
---|
1 | LIB "tst.lib";tst_init(); |
---|
2 | proc test5 (int p) |
---|
3 | { |
---|
4 | ring r= p, x(1..11), dp; |
---|
5 | poly d1= x(1) + 1; |
---|
6 | poly d2= x(2) + 1; |
---|
7 | poly f1= x(1) - 2; |
---|
8 | poly f2= x(2) - 2; |
---|
9 | poly g1= x(1) + 2; |
---|
10 | poly g2= x(2) + 2; |
---|
11 | poly d= d1*d2 - 2; |
---|
12 | poly f= f1*f2 + 2; |
---|
13 | poly g= g1*g2 - 2; |
---|
14 | f= f*d; |
---|
15 | g= g*d; |
---|
16 | poly testgcd= gcd (f,g); |
---|
17 | testgcd= testgcd/leadcoef (testgcd); |
---|
18 | testgcd == d; |
---|
19 | int i; |
---|
20 | for (i= 3; i <= 11; i++) |
---|
21 | { |
---|
22 | d2= d2*(x(i) + 1); |
---|
23 | f2= f2*(x(i) - 2); |
---|
24 | g2= g2*(x(i) + 2); |
---|
25 | |
---|
26 | d= d1*d2 - 2; |
---|
27 | f= f1*f2 + 2; |
---|
28 | g= g1*g2 - 2; |
---|
29 | f= f*d; |
---|
30 | g= g*d; |
---|
31 | testgcd= gcd (f,g); |
---|
32 | testgcd= testgcd/leadcoef (testgcd); |
---|
33 | testgcd == d; |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | test5 (3); |
---|
38 | tst_status(); |
---|
39 | test5 (43051); |
---|
40 | tst_status(); |
---|
41 | test5 (0); |
---|
42 | tst_status(); |
---|
43 | tst_status(1); |
---|
44 | $ |
---|
Note: See
TracBrowser
for help on using the repository browser.