擅长:python、mysql、java
<p>您可以在<a href="http://docs.sympy.org/dev/modules/mpmath/functions/orthogonal.html" rel="nofollow">its documentation</a>中找到解决<code>SymPy</code>问题的简单示例实现:</p>
<pre><code>>>> for n in range(5):
... nprint(polyroots(taylor(lambda x: legendre(n, x), 0, n)[::-1]))
...
[]
[0.0]
[-0.57735, 0.57735]
[-0.774597, 0.0, 0.774597]
[-0.861136, -0.339981, 0.339981, 0.861136]
</code></pre>
<p>正如前面的答案所示,这个例子使用了多项式的泰勒展开式。在</p>