X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fnormalization.cpp;h=4a212988e3d8def83dd21097236207fe97c9060d;hp=78ae63174a953b19f90540ec627e0a2b79638bcc;hb=18aac87043fded3692557cf49f768ecb48ba3ba6;hpb=955cb185a85535ab328ffedbfccdc508ce80fa91 diff --git a/check/normalization.cpp b/check/normalization.cpp index 78ae6317..4a212988 100644 --- a/check/normalization.cpp +++ b/check/normalization.cpp @@ -3,7 +3,7 @@ * Rational function normalization test suite. */ /* - * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,11 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include "ginac.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static symbol x("x"), y("y"), z("z"); @@ -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);