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')
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to
Hi,
On 16 June 2011 20:09, smichr 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
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))
Hi,
On 16 June 2011 13:28, Aaron Meurer wrote:
> 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
Well, the thing that bugs me the most is that you can do the same things with
what would appear to be rational functions:
In [7]: Poly(1/x)
Out[7]: Poly(1/x, 1/x, domain='ZZ')
In [8]: Poly(1/x)*x
Out[8]: Poly(x*1/x, 1/x, domain='ZZ[x]')
In [9]: Poly(1/x)*x - 1
Out[9]: Poly(x*1/x - 1, 1/x, domai
By the way, I forgot to mention that I think it would be better to just support
negative exponents directly in Poly rather than creating a LaurentPoly class.
At the very least, Poly shouldn't pretend it is doing Laurent polynomials (like
with Poly(x + 1/x)) when it really isn't.
Aaron Meurer