+
+def lagrange_denominator(k, xs):
+ """
+ Return the denominator of the kth Lagrange coefficient.
+
+ INPUT:
+
+ - ``k`` -- The index of the coefficient.
+
+ - ``xs`` -- The list of points at which the function values are
+ known.
+
+ OUTPUT:
+
+ The product of all xs[j] with j != k.
+
+ """
+ return product([xs[k] - xs[j] for j in range(0, len(xs)) if j != k])
+
+