TESTS::
sage: xs = [ -pi/2, -pi/6, 0, pi/6, pi/2 ]
- sage: ys = map(sin, xs)
+ sage: ys = list(map(sin, xs))
sage: L = lagrange_polynomial(x, xs, ys)
sage: expected = 27/16*(pi - 6*x)*(pi - 2*x)*(pi + 2*x)*x/pi^4
sage: expected -= 1/8*(pi - 6*x)*(pi - 2*x)*(pi + 6*x)*x/pi^4
TESTS::
sage: xs = [0]
- sage: ys = map(sin, xs)
+ sage: ys = list(map(sin, xs))
sage: divided_difference(xs, ys)
0
sage: xs = [0, pi]
- sage: ys = map(sin, xs)
+ sage: ys = list(map(sin, xs))
sage: divided_difference(xs, ys)
0
sage: xs = [0, pi, 2*pi]
- sage: ys = map(sin, xs)
+ sage: ys = list(map(sin, xs))
sage: divided_difference(xs, ys)
0
TESTS::
sage: xs = [ -pi/2, -pi/6, 0, pi/6, pi/2 ]
- sage: ys = map(sin, xs)
+ sage: ys = list(map(sin, xs))
sage: L = lagrange_polynomial(x, xs, ys)
sage: N = newton_polynomial(x, xs, ys)
sage: bool(N == L)
TESTS::
sage: xs = [ 0, pi/6, pi/2 ]
- sage: ys = map(sin, xs)
- sage: y_primes = map(cos, xs)
+ sage: ys = list(map(sin, xs))
+ sage: y_primes = list(map(cos, xs))
sage: H = hermite_interpolant(x, xs, ys, y_primes)
sage: expected = -27/4*(pi - 6*x)*(pi - 2*x)^2*sqrt(3)*x^2/pi^4
sage: expected += (5*(pi - 2*x)/pi + 1)*(pi - 6*x)^2*x^2/pi^4