Comment #125 on issue 1694 by nicolas.pourcelot: solve has many issues with fractions
http://code.google.com/p/sympy/issues/detail?id=1694

Ok, Chris, I've seen your patch (sympy/functions/elementary/exponential.py).

class log(Function):
...
    def as_numer_denom(self):
         n, d = self.args[0].as_numer_denom()
-        if d is S.One:
-            return self.func(n), d
-        return (self.func(n) - self.func(d)).as_numer_denom()
+        if d != 1:
+            selfx = self.expand(log=1)
+            if selfx.func != self.func:
+                return selfx.as_numer_denom()
+        return self, S.One

This solves the problem of doing log(x/y) == log(x) - log(y) without checking x and y assumptions.

However, it will still expand log(x/y) if x>0 and y>0.
While this is perfectly correct, I can't see the point of doing this.

Personally, I'd expect log(x/y).as_numer_denom() to simply return (log(x/y), 1) in any case.

Did I miss something ?

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to