Updates:
        Status: Started
        Labels: NeedsBetterPatch

Comment #5 on issue 1565 by ondrej.certik: powsimp() does not combine  
exponents in some cases.
http://code.google.com/p/sympy/issues/detail?id=1565

I get some conflicts when merging your branch. I apologize for forgetting  
about this.
do you know how to fix this easily?

$ git di
diff --cc sympy/simplify/simplify.py
index 027f1cf,efc7da5..0000000
--- a/sympy/simplify/simplify.py
+++ b/sympy/simplify/simplify.py
@@@ -1042,32 -934,33 +1042,55 @@@ def powsimp(expr, deep=False, combine='
           combine='exp' will strictly only combine exponents in the way  
that use
           to be automatic.  Also use deep=True if you need the old behavior.

+         When combine='all', 'exp' is evaluated first.  Consider the first
+         example below for when there could be an ambiguity relating to  
this.
+         This is done so things like the second example can be completely
+         combined.  If you want 'base' combined first, do something like
+         powsimp(powsimp(expr, combine='base'), combine='exp').
+
       == Examples ==
           >>> from sympy import *
++<<<<<<< HEAD:sympy/simplify/simplify.py
  +        >>> x,n = symbols('xn')
  +        >>> e = x**n * (x*n)**(-n) * n
  +        >>> powsimp(e)
  +        n**(1 - n)
  +
  +        >>> powsimp(log(e))
  +        log(n*x**n*(n*x)**(-n))
  +
  +        >>> powsimp(log(e), deep=True)
  +        log(n**(1 - n))
  +
  +        >>> powsimp(e, combine='exp')
  +        n*x**n*(n*x)**(-n)
  +        >>> powsimp(e, combine='base')
  +        n*(1/n)**n
  +
  +        >>> y, z = symbols('yz')
  +        >>> a = x**y*x**z*n**z*n**y
  +        >>> powsimp(a, combine='exp')
++=======
+         >>> x, y, z, n = symbols('xyzn')
+         >>> powsimp(x**y*x**z*y**z, combine='all')
+         x**(y + z)*y**z
+         >>> powsimp(x**y*x**z*y**z, combine='exp')
+         x**(y + z)*y**z
+         >>> powsimp(x**y*x**z*y**z, combine='base')
+         x**y*(x*y)**z
+
+         >>> powsimp(x**z*x**y*n**z*n**y, combine='all')
+         (n*x)**(y + z)
+         >>> powsimp(x**z*x**y*n**z*n**y, combine='exp')
++>>>>>>> aaron/powsimp-fix:sympy/simplify/simplify.py
           n**(y + z)*x**(y + z)
-         >>> powsimp(a, combine='base')
+         >>> powsimp(x**z*x**y*n**z*n**y, combine='base')
           (n*x)**y*(n*x)**z
-         >>> powsimp(a, combine='all')
-         (n*x)**(y + z)
+
+         >>> powsimp(log(exp(x)*exp(y)))
+         log(exp(x)*exp(y))
+         >>> powsimp(log(exp(x)*exp(y)), deep=True)
+         x + y
       """
       if combine not in ['all', 'exp', 'base']:
               raise ValueError, "combine must be one of  
('all', 'exp', 'base')."


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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

Reply via email to