]> www.ginac.de Git - ginac.git/commitdiff
- checks adapted to new GCD behavior for partly-factored input polynomials
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 25 Jan 2000 22:31:49 +0000 (22:31 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 25 Jan 2000 22:31:49 +0000 (22:31 +0000)
check/normalization.cpp
check/poly_gcd.cpp

index fa14496a85c38bcd184b220545633330b89ebd12..1c3ac9c7b9e7af337296fda7eb129bc6ee86090a 100644 (file)
@@ -73,6 +73,16 @@ static unsigned normal1(void)
     e = (pow(x, -1) + x) / (pow(x , 2) * 2 + 2);
     d = pow(x * 2, -1);
     result += check_normal(e, d);
+
+       // Fraction cancellation with rational coefficients
+       e = (pow(x, 2) - pow(y, 2)) / pow(x/2 - y/2, 3);
+       d = (8 * x + 8 * y) / (pow(x, 2) + pow(y, 2) - x * y * 2);
+       result += check_normal(e, d);
+
+       // Fraction cancellation with rational coefficients
+       e = z/5 * (x/7 + y/10) / (x/14 + y/20);
+       d = 2*z/5;
+       result += check_normal(e, d);
     
     // Distribution of powers
     e = pow(x/y, 2);
index 37a310fdfb79c916811e5cc2979ed10c99845bdf..0d8327a39e2dd8023268cd580f9270708d953573 100644 (file)
@@ -68,7 +68,7 @@ static unsigned poly_gcd2(void)
                ex d = pow(e1 + 1, 2);
                ex f = d * pow(e2 - 2, 2);
                ex g = d * pow(e1 + 2, 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 2, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -88,7 +88,7 @@ static unsigned poly_gcd3(void)
                ex d = e1 + 1;
                ex f = d * (e1 - 2);
                ex g = d * (e1 + 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 3, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -111,7 +111,7 @@ static unsigned poly_gcd3p(void)
                ex d = e1 + 1;
                ex f = d * (e1 - 2);
                ex g = d * (e2 + 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 3p, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -136,7 +136,7 @@ static unsigned poly_gcd4(void)
                ex d = e1 + 1;
                ex f = d * (e2 - 1);
                ex g = d * pow(e3 + 2, 2);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 4, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -161,7 +161,7 @@ static unsigned poly_gcd5(void)
                ex d = e1 - 3;
                ex f = d * (e2 + 3);
                ex g = d * (e3 - 3);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 5, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -181,7 +181,7 @@ static unsigned poly_gcd5p(void)
                ex d = e1 - 1;
                ex f = d * (e1 + 3);
                ex g = d * (e1 - 3);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 5p, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;
@@ -199,7 +199,7 @@ static unsigned poly_gcd6(void)
                ex d = pow(x, j) * y * (z - 1);
                ex f = d * (pow(x, j) + pow(y, j + 1) * pow(z, j) + 1);
                ex g = d * (pow(x, j + 1) + pow(y, j) * pow(z, j + 1) - 7);
-               ex r = gcd(f, g);
+               ex r = gcd(f.expand(), g.expand());
                if (!(r - d).expand().is_zero()) {
                        clog << "case 6, gcd(" << f << "," << g << ") = " << r << " (should be " << d << ")" << endl;
                        return 1;