return sigma
+
+def divided_difference_coefficients(xs):
+ """
+ Assuming some function `f`, compute the coefficients of the
+ divided difference f[xs[0], ..., xs[n]].
+
+ TESTS:
+
+ sage: divided_difference_coefficients([0])
+ [1]
+ sage: divided_difference_coefficients([0, pi])
+ [-1/pi, 1/pi]
+ sage: divided_difference_coefficients([0, pi, 2*pi])
+ [1/2/pi^2, -1/pi^2, 1/2/pi^2]
+
+ """
+ coeffs = [ product([ (QQ(1) / (xj - xi)) for xi in xs if xi != xj ])
+ for xj in xs ]
+ return coeffs
+
def divided_difference(f, xs):
"""
Return the Newton divided difference of `f` at the points