]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_trans.cpp
Added log(exp(x)) -> x for real symbols.
[ginac.git] / ginac / inifcns_trans.cpp
index 239b1ea2ea1d8a3130130a9e32ee77d28458cf3b..75b812102bbccef71eb218b24a3e723c2f2e0cea 100644 (file)
@@ -124,6 +124,9 @@ static ex log_eval(const ex & x)
        // log(exp(t)) -> t (if -Pi < t.imag() <= Pi):
        if (is_ex_the_function(x, exp)) {
                const ex &t = x.op(0);
+               if (is_a<symbol>(t) && (ex_to<symbol>(t).get_domain() == symbol_options::real)) {
+                       return t;
+               }
                if (t.info(info_flags::numeric)) {
                        const numeric &nt = ex_to<numeric>(t);
                        if (nt.is_real())