Updates:
        Labels: EasyToFix

Comment #3 on issue 3889 by [email protected]: expand_log(exp(x), force=True) should give x
http://code.google.com/p/sympy/issues/detail?id=3889

It's me that sent the patch...someone else can take this as an EasyToFix.

diff --git a/sympy/functions/elementary/exponential.py b/sympy/functions/elementary/exponential.py
index 8c749cd..9d15d7e 100644
--- a/sympy/functions/elementary/exponential.py
+++ b/sympy/functions/elementary/exponential.py
@@ -594,11 +594,10 @@ def _eval_expand_log(self, deep=True, **hints):
                 else:
                     nonpos.append(x)
             return Add(*expr) + log(Mul(*nonpos))
-        elif arg.is_Pow:
-            if force or (arg.exp.is_real and arg.base.is_positive) or \
-                    arg.base.is_polar:
-                b = arg.base
-                e = arg.exp
+        elif arg.is_Pow or isinstance(arg, exp):
+            b, e = arg.as_base_exp()
+            if force or (e.is_real and b.is_positive) or \
+                    b.is_polar:
                 a = self.func(b)
                 if isinstance(a, log):
                     return unpolarify(e) * a._eval_expand_log(**hints)


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to