]> www.ginac.de Git - ginac.git/blobdiff - check/exam_powerlaws.cpp
Small optimization in simplify_indexed.
[ginac.git] / check / exam_powerlaws.cpp
index 4977d4f0024c226848c2a35fef5b17406042c062..81a7625d99ded8858f81e6f7da4e8d7f267633fc 100644 (file)
@@ -4,7 +4,7 @@
  *  this code, it is a sanity check rather deeply rooted in GiNaC's classes. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2014 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
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <iostream>
 #include "ginac.h"
-using namespace std;
 using namespace GiNaC;
 
+#include <iostream>
+using namespace std;
+
 static unsigned exam_powerlaws1()
 {
        // (x^a)^b = x^(a*b)
@@ -68,14 +69,14 @@ static unsigned exam_powerlaws1()
                return 1;
        }
        
-       ex e4 = e1.subs(lst(a==-1, b==2.5));
+       ex e4 = e1.subs(lst(a==-1, b==-2.5));
        if (!(is_exactly_a<power>(e4) &&
              is_exactly_a<power>(e4.op(0)) &&
              is_exactly_a<symbol>(e4.op(0).op(0)) &&
              is_exactly_a<numeric>(e4.op(0).op(1)) &&
              is_exactly_a<numeric>(e4.op(1)) &&
-             e4.is_equal(power(power(x,-1),2.5)) )) {
-               clog << "(x^a)^b, x symbolic, a==-1, b==2.5 wrong" << endl;
+             e4.is_equal(power(power(x,-1),-2.5)) )) {
+               clog << "(x^a)^b, x symbolic, a==-1, b==-2.5 wrong" << endl;
                clog << "returned: " << e4 << endl;
                return 1;
        }