[PATCH] refine: Let refine_Pow work harder to simplify powers of (-1)

2010-02-22 Thread Øyvind Jensen
Before, 'refine_Pow' would simplify (-1)**exp only if 'exp' as a whole couold be determined as even or odd. A doctest like, >>> refine_Pow((-1)**(x+y), Assume(x, Q.even)) (-1)**y would fail. This patch fixes that by treating powers of S.NegativeOne as a special case. Every term

Re: [PATCH] refine: Let refine_Pow work harder to simplify powers of (-1)

2010-02-22 Thread Aaron S. Meurer
On Feb 22, 2010, at 12:43 PM, Øyvind Jensen wrote: > Before, 'refine_Pow' would simplify (-1)**exp only if 'exp' as a whole couold > be determined as even or odd. A doctest like, > > >>> refine_Pow((-1)**(x+y), Assume(x, Q.even)) > (-1)**y > > would fail. This patch fixes that by