cswiercz/abelfunctions — Issue #3: puiseux._new_polynomial() is slow
Author: cswiercz
Created: 2012-03-07 18:28:42+00:00
State: open
Labels: enhancement

The computation of the regularized curve in `puiseux._new_polynomial()` is slow. Investigate and implement ways to improve this. Some questions that may lead to an answer:

* Are there bounds on degree that we need to accurately define the corresponding Newton polygon?
* `_new_polynomial()` uses `.subs()` to perform the symbolic polynomial evaluation. Is there a cleaner way to do this in sympy?
* In the (rare?) event that the values fo `tau` and `l` are similar across, see if cacheing by argument is a viable quick fix.

Here's the code for reference:

```python
def _new_polynomial(F,X,Y,tau,l):
q,mu,m,beta = tau
Fnew = F.subs([(X,mu*X**q), (Y,X**m*(beta+Y))])
Fnew = (Fnew/(X**l)).expand()
return Fnew
```