Finding roots of higher order polynomial

43 views
Skip to first unread message

Ondřej Čertík

unread,
Apr 8, 2014, 6:06:39 PM4/8/14
to sympy
Hi,

We have this problem here -- we need to find numerical roots of a
higher order polynomial and it's immediate in Mathematica, and
virtually infinite in SymPy:

https://github.com/sympy/sympy/issues/7386

For our application, we just need few digits, but ultimately, we would
like arbitrary precision as well. The polynomial has integers that can
be larger. See the issue for more details.

If anybody has any ideas what the state of the art algorithms are for
finding the roots, please let me know.

Ondrej

Ondřej Čertík

unread,
Apr 8, 2014, 7:15:26 PM4/8/14
to sympy
Ok, so the solution is to use nroots(), then the solution is immediate,
see the issue.

It's confusing why the way we did is slow.

Ondrej

Aaron Meurer

unread,
Apr 8, 2014, 7:17:07 PM4/8/14
to sy...@googlegroups.com
RootOf.n() uses a rigorous root isolation algorithm, not something fast like Newton's method.

By the way, I think this is not the first time this has come up (even from you actually). So probably our documentation needs improving. Or maybe we should change some defaults.

Aaron Meurer




Ondrej

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CADDwiVACb3D6F2kp77pJ%2BgP6sejEBPqagRYTiqjSz_FkGFXHZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ondřej Čertík

unread,
Apr 9, 2014, 4:12:44 PM4/9/14
to sympy
On Tue, Apr 8, 2014 at 5:17 PM, Aaron Meurer <asme...@gmail.com> wrote:
> RootOf.n() uses a rigorous root isolation algorithm, not something fast like
> Newton's method.
>
> By the way, I think this is not the first time this has come up (even from
> you actually). So probably our documentation needs improving. Or maybe we
> should change some defaults.

That's right, I just remembered we should be using nroots() right here:

https://github.com/sympy/sympy/blob/master/sympy/integrals/quadrature.py

Except that when I just tried it, I discovered many bugs both in mpmath and in
nroots(), which I tried to fix here:

https://github.com/sympy/sympy/pull/7393

Ondrej
Reply all
Reply to author
Forward
0 new messages