def test_clenshaw(tol=1.0e-14):
n = 5
_, _, alpha, beta = \
orthopy.line.recurrence_coefficients.legendre(n, 'monic')
t = 1.0
a = numpy.ones(n+1)
value = orthopy.line.clenshaw(a, alpha, beta, t)
ref = math.fsum([
numpy.polyval(legendre(i, monic=True), t)
for i in range(n+1)])
assert abs(value - ref) < tol
return
评论列表
文章目录