These are chat archives for symengine/symengine
In : Poly((x+1)**-2 + (x+1)**-1) Out: Poly(1/(x + 1) + 1/(x**2 + 2*x + 1), 1/(x + 1), 1/(x**2 + 2*x + 1), domain='ZZ')
Polyis designed to work with expressions that can be regarded as polynomials (with no negative exponents or denominators). Otherwise the result may be unexpected.
Powcan be 'expanded' to an
Addor not, eg.
In : Poly(x**-2 + x**-1) Out: Poly(1/x**2 + 1/x, 1/x, domain='ZZ')
Polyin case of negative exponents. They should not be used in code anyway. Instead, one should first separate the numerator and denominator (by
as_numer_denom) and then apply
(x - 1)**-3becomes
1/(x - 1)**3.) Then a common multiple of the denominators of all terms becomes the new denominator. It could be the lcm but I'm not sure if that is actually computed.
UIntPoly::from_basic(div(x, 2))Error or
In : Poly(x/2, domain="ZZ")
UIntPoly::from_basic(pow(2, div(x, 2))). This will return a poly, with the genarator as itself, right?
In : Poly(2**(x/2)) Out: Poly(2**(x/2), 2**(x/2), domain='ZZ')