log_eval: don't apply the log(x^p) -> p*log(x) rule.
authorAlexei Sheplyakov <Alexei.Sheplyakov@gmail.com>
Sat, 18 Jan 2014 12:13:46 +0000 (14:13 +0200)
committerAlexei Sheplyakov <Alexei.Sheplyakov@gmail.com>
Tue, 28 Jan 2014 09:33:01 +0000 (11:33 +0200)
Automatically transforming log(p^2) into 2 log(p) might be quite annoying.
Perhaps this transformation should be moved to expand() and applied only
if expand_options::expand_transcendental is specified.

check/exam_inifcns.cpp
ginac/inifcns_trans.cpp

index 32368e6..3a1a36b 100644 (file)
@@ -310,9 +310,6 @@ static unsigned inifcns_consist_log()
        if (!e1.is_equal(e2))
                ++result;
 
-       if (!ex(log(pow(p,a))).is_equal(a*log(p)))
-               ++result;
-
        // shall not do for non-real powers
        if (ex(log(pow(p,z))).is_equal(z*log(p)))
                ++result;
index 56d909c..c5551f7 100644 (file)
@@ -175,11 +175,6 @@ static ex log_eval(const ex & x)
                        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();
 }