Description of problem:
>>> from mpmath import *
>>> mp.dps = 15; mp.pretty = True
>>> nprint(polyroots([1,-1,-14,24], error=True), 4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/mpmath/calculus/polynomials.py", line 201, in polyroots
err = max(err, ctx.ldexp(1, -orig+1))
NameError: global name 'orig' is not defined
This used to work with python-mpmath-0.18-1 on F20. This is causing a sympy test failure on Rawhide and F20. It looks like an "orig = ctx.prec" statement is missing from that function.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run the python code shown above
([-4.0, 2.0, 3.0], 2.22e-16)
I just reported this in upstream's Google Groups forum. It appears there is a second problem with the polyroots function, leading to lack of convergence on a solution in some cases, so it may be worth waiting for upstream to investigate that issue.
Created attachment 964784 [details]
Patch to fix the polyroots function
The second bug can be worked around, but this one cannot. Would you please do a build of mpmath with the attached patch applied?
python-mpmath-0.19-2.fc20 has been submitted as an update for Fedora 20.
python-mpmath-0.19-2.fc21 has been submitted as an update for Fedora 21.
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-mpmath-0.19-2.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
python-mpmath-0.19-2.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.