[Scipy-tickets] [SciPy] #1466: More accurate roots/weights for Gauss-Hermite quadrature
SciPy Trac
scipy-tickets@scipy....
Tue Jun 28 01:37:51 CDT 2011
#1466: More accurate roots/weights for Gauss-Hermite quadrature
---------------------------+------------------------------------------------
Reporter: Bogdan | Owner: pv
Type: enhancement | Status: new
Priority: normal | Milestone: Unscheduled
Component: scipy.special | Version: devel
Keywords: |
---------------------------+------------------------------------------------
Comment(by Bogdan):
Yes, this trick certainly does improve the accuracy. Although recursive
algorithm is still slightly better; comparing it with this function:
{{{
def h_roots_numpy(n):
p = H([0]*n + [1])
r = p.roots()
r1 = r - p(r)/(p.deriv()(r))
return r1, (2 ** (n-1)) * factorial(n) * numpy.sqrt(numpy.pi) /
(p.deriv()(r1) ** 2) * 4.0
}}}
for N=77, M=70 I get
{{{
Numpy roots: 0.823443522596
Recursive roots: 1.0
}}}
And with increasing N h_roots_numpy() just goes haywire.
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1466#comment:2>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list