Fix evaluation of log(p^a) -> a*log(p), if p>0 and a is real.
authorVladimir V. Kisil <kisilv@maths.leeds.ac.uk>
Sat, 28 Dec 2013 23:58:40 +0000 (23:58 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Sat, 28 Dec 2013 23:58:40 +0000 (23:58 +0000)
This evaluation was broken with commit e5c76f659e2e882d.

ginac/inifcns_trans.cpp

index 6ee0a23..56d909c 100644 (file)
@@ -174,7 +174,12 @@ static ex log_eval(const ex & x)
                if (t.info(info_flags::real))
                        return t;
        }
-       
+
+       // log(p^a) -> a*log(p), if p>0 and a is real
+       if (is_exactly_a<power>(x) && x.op(0).info(info_flags::positive) && x.op(1).info(info_flags::real)) {
+               return x.op(1)*log(x.op(0));
+       }
+
        return log(x).hold();
 }