X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fnormalization.cpp;h=814c45be9cdfc80fa00d50be60a7932701d0288c;hp=4a212988e3d8def83dd21097236207fe97c9060d;hb=083b0f50275a536be807fa2a34c1e278098e12f5;hpb=35267c690dfa19cdb1ddafa3c1d2c5e3640f6891 diff --git a/check/normalization.cpp b/check/normalization.cpp index 4a212988..814c45be 100644 --- a/check/normalization.cpp +++ b/check/normalization.cpp @@ -26,7 +26,7 @@ using namespace GiNaC; #endif // ndef NO_NAMESPACE_GINAC -static symbol x("x"), y("y"), z("z"); +static symbol w("w"), x("x"), y("y"), z("z"); static unsigned check_normal(const ex &e, const ex &d) { @@ -55,21 +55,31 @@ static unsigned normal1(void) result += check_normal(e, d); // Fraction addition - e = numeric(2)/x + y/3; - d = (x*y/3 + 2) / x; + e = 2/x + y/3; + d = (x*y + 6) / (x*3); result += check_normal(e, d); - // Fraction addition e = pow(x, -1) + x/(x+1); d = (pow(x, 2)+x+1)/(x*(x+1)); result += check_normal(e, d); // Fraction cancellation + e = numeric(1)/2 * z * (2*x + 2*y); + d = z * (x + y); + result += check_normal(e, d); + + e = numeric(1)/6 * z * (3*x + 3*y) * (2*x + 2*w); + d = z * (x + y) * (x + w); + result += check_normal(e, d); + + e = (3*x + 3*y) * (w/3 + z/3); + d = (x + y) * (w + z); + result += check_normal(e, d); + e = (pow(x, 2) - pow(y, 2)) / pow(x-y, 3); d = (x + y) / (pow(x, 2) + pow(y, 2) - x * y * 2); result += check_normal(e, d); - // Fraction cancellation e = (pow(x, -1) + x) / (pow(x , 2) * 2 + 2); d = pow(x * 2, -1); result += check_normal(e, d);