Christopher Smith

Results 210 comments of Christopher Smith

If you want a higher precision version of the rounded number you can create it from the string representation of the number: ```python >>> Float(str(ra))+Float(str(rb)) -10.2 >>> pround = lambda...

It is not clear to me that the precision should not be adjusted to reflect the precision of the digit to which the number has been rounded. If you don't...

> Instead of altering simplify It should be part of the `simplify` machinery. The same sort of constant removal happens when simplifying `Sum(2*x,(x,1,4))` to get `2*Sum(x,(x,1,4))`. The `factor_terms` routine is...

It seems like best practice to import directly from the module (otherwise the entire namespace of the module from which you import is being added to the local namespace?). The...

I am not sure if it is a good idea to convert the input to Integer/Rational. Do you see an issue with doing so? In general, calculations with Python base...

Interesting approach with a series. It is slow and only gives a single possible answer, however: ```python >>> eq = 4*x**5 + 2*x + 1 >>> t=time();s = (eq**n).series(x,0,n=8).simplify().coeff(x**7);time()-t 7.715553522109985...

To get the coefficient of a a term in a non-symbolic, exponentiated polynomial, the following is very fast: ```python def polym_nth(p, m, n): """return coefficient of x**n in p**m where...

I'm not sure when is best to use this. When expanding from known roots then the coefficient of `x**n` is 1, otherwise if expanding a `Mul`, one would have to...

Whatever change you make, please make sure that 1) the continuation character is unambiguous and 2) the unwrapped long expression can be easily reconstructed with fidelity by code and by...

@asmeurer, were you thinking of [this](https://stackoverflow.com/questions/59414420/how-to-find-the-nth-term-of-a-generating-function-using-sympy)? or leading term analysis as discussed [here](https://github.com/sympy/sympy/issues/6322)? I don't recall being able to pull out a single coefficient well. This was discussed for the...