from sage.all import *
-from misc import product
+product = prod
def lagrange_denominator(k, xs):
sage: xs = [ -pi/2, -pi/6, 0, pi/6, pi/2 ]
sage: lagrange_coefficient(0, x, xs)
- 1/8*(pi - 6*x)*(pi - 2*x)*(pi + 6*x)*x/pi^4
+ 1/8*(pi + 6*x)*(pi - 2*x)*(pi - 6*x)*x/pi^4
"""
numerator = lagrange_psi(x, xs)/(x - xs[k])
def lagrange_polynomial(x, xs, ys):
"""
- Return the Lagrange form of the interpolation polynomial in `x` of
+ Return the Lagrange form of the interpolating polynomial in `x`
at the points (xs[k], ys[k]).
INPUT: