This is related to http://code.google.com/p/sympy/issues/detail?id=2032. The polys pretend that they can work in K[x, 1/x], but they actually do not implement things properly, which can lead to wrong results:
In [3]: Poly(exp(-x)) Out[3]: Poly(exp(-x), exp(-x), domain='ZZ') In [4]: Poly(exp(-x))*exp(x) Out[4]: Poly(exp(x)*exp(-x), exp(-x), domain='ZZ[exp(x)]') In [5]: Poly(exp(-x))*exp(x) - 1 Out[5]: Poly(exp(x)*exp(-x) - 1, exp(-x), domain='ZZ[exp(x)]') In [6]: (Poly(exp(-x))*exp(x) - 1).is_zero Out[6]: False And I could go further, as an incorrect is_zero result can easily be exacerbated to larger wrong results, but you get the idea. Aaron Meurer On Thu, Jun 16, 2011 at 12:15 PM, Mateusz Paprocki <matt...@gmail.com> wrote: > Hi, > > On 16 June 2011 20:09, smichr <smi...@gmail.com> wrote: >> >> The exp(x)*exp(-x) term in the Poly should cancel, shouldn't it? >> >>> Poly(exp(x) + exp(-x) - y)*exp(x) >> Poly(-y*exp(x) + exp(-x)*exp(x) + exp(x)**2, y, exp(-x), exp(x), >> domain='ZZ') > > Polynomials can't contain negative exponents, so exp(x) and exp(-x) = > 1/exp(x) are treated as two different generators. > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To post to this group, send email to sympy@googlegroups.com. >> To unsubscribe from this group, send email to >> sympy+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/sympy?hl=en. >> > > Mateusz > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.