Comment #4 on issue 3295 by [email protected]: nroots and RootOf.evalf duplicate code
http://code.google.com/p/sympy/issues/detail?id=3295

Aaron, your observations from comment #3 are all correct. The algorithm underneath RootOf is from the 1992 paper by Collins. The algorithm is purely symbolic and thus can't fail (up to implementation bugs) but can take ages to compute for large inputs (there exists a similar hybrid symbolic-numeric method that solves speed issues but is not implemented in SymPy).

nroots() uses mpmath's polyroots() which is a global algorithm for numerical root approximation. RootOf.evalf() uses symbolic root isolation algorithm to isolate individual roots and refine root isolation intervals until mpmath's findroot() algorithm can be used to approximate each single root to high precision.

The implementation of RootOf's _eval_evalf may be, however, wrong if we look at issue 3294. I debugged it and root isolation works fine, but findroot() doesn't succeed for any interval. Either this is a weakness of findroot() or it's been used improperly in _eval_evalf() (e.g. I may be tracking/setting precision improperly).

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to