New issue 2814 by asme...@gmail.com: ValueError: can't raise polynomial to
a negative power with solve()
http://code.google.com/p/sympy/issues/detail?id=2814
In [84]: solve(((x - 1.1)/(x + 0.1))**(0.83) - C*exp(t), x)
...
ValueError: can't raise polynomial to a negative power
>>> from sympy.solvers.solvers import _tsolve
>>> _tsolve(((x - 1.1)/(x + 0.1))**(0.83) - C*exp(t), x)
[0.1*(C*exp(t))**1.20481927710843/(-(C*exp(t))**1.20481927710843 + 1) +
1.1/(-(C
*exp(t))**1.20481927710843 + 1)]
Issue 2831 has been merged into this issue.
The expression from comment 1 now gives a recursion error, and the one from
comment 1 works.
But the one from issue 2831 still gives the problem. The problem is in
cancel().
Another expression that gives the problem, reported to me on IRC is
a = S("((-2*tanh(x - 3.0)**2 + 2)*(-tanh(x - 3.0)**2 + 1)*tanh(x +
3.0)**2/2 + (-2*tanh(x - 3.0)**2 + 2)*(-2*tanh(x + 3.0)**2 + 2)*tanh(x -
3.0)*tanh(x + 3.0) - (-2*tanh(x - 3.0)**2 + 2)*tanh(x - 3.0)**2*tanh(x +
3.0)**2 + (-2*tanh(x + 3.0)**2 + 2)*(-tanh(x + 3.0)**2 + 1)*tanh(x -
3.0)**2/2 - (-2*tanh(x + 3.0)**2 + 2)*tanh(x - 3.0)**2*tanh(x +
3.0)**2)/(2*sqrt(tanh(x - 3.0)**2*tanh(x + 3.0)**2 + 0.0001)) +
(-(-2*tanh(x - 3.0)**2 + 2)*tanh(x - 3.0)*tanh(x + 3.0)**2/2 - (-2*tanh(x +
3.0)**2 + 2)*tanh(x - 3.0)**2*tanh(x + 3.0)/2)*((-2*tanh(x - 3.0)**2 +
2)*tanh(x - 3.0)*tanh(x + 3.0)**2/2 + (-2*tanh(x + 3.0)**2 + 2)*tanh(x -
3.0)**2*tanh(x + 3.0)/2)/(2*(tanh(x - 3.0)**2*tanh(x + 3.0)**2 +
0.0001)**(3/2))")
Comment #4 on issue 2814 by asme...@gmail.com: ValueError: can't raise
polynomial to a negative power with solve()
http://code.google.com/p/sympy/issues/detail?id=2814
Well, I remember seeing this before, but I can't find the issue. It happens
because the while loop at line 1310 in densearith.py runs one too many
times, because the floating point coefficients do not cancel like the
algorithm expects them to. I don't know if this can be fixed without
implementing RR(eps). See issue 2935.
even if nsimplify is used to give Rationals instead of floats, infinite
recursion is generated.