Comment #3 on issue 1439 by mattpap: polynomial solution missing real roots
http://code.google.com/p/sympy/issues/detail?id=1439

Now this example works fine:

In [1]: f = -1936 - 5056*x - 7592*x**2 + 2704*x**3 - 49*x**4

In [2]: intervals(f)
Out[2]: [((3, 4), 1), ((52, 53), 1)]

In [3]: nroots(f)
Out[3]: [3.61647091846116, 52.1759485873647, -0.304373018219039 -
0.341681290265043⋅ⅈ, -0.304373018219039 + 0.341681290265043⋅ⅈ]

In [4]: R = roots(f)

In [5]: len(R)
Out[5]: 4

In [6]: R.keys()[0].evalf()
Out[6]: 3.61647091846116

In [7]: R.keys()[1].evalf()
Out[7]: 52.1759485873647

In [8]: R.keys()[2].evalf()
Out[8]: -0.304373018219039 - 0.341681290265043⋅ⅈ

In [9]: R.keys()[3].evalf()
Out[9]: -0.304373018219039 + 0.341681290265043⋅ⅈ

In [10]: R = solve(f, x)

In [11]: len(R)
Out[11]: 4

In [12]: R[0].evalf()
Out[12]: 3.61647091846116

In [13]: R[1].evalf()
Out[13]: 52.1759485873647

In [14]: R[2].evalf()
Out[14]: -0.304373018219039 - 0.341681290265043⋅ⅈ

In [15]: R[3].evalf()
Out[15]: -0.304373018219039 + 0.341681290265043⋅ⅈ


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
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