1 function coefficients = divided_difference_coefficients(xs)
2 ## Compute divided difference coefficients of `f` at points `xs`.
6 ## * ``xs`` - A vector containing x-coordinates.
10 ## * ``coefficients`` - The vector of coefficients such that
11 ## dot(coefficients, f(xs)) == dd. Used to solve linear systems.
20 ## Append (xj - xi) to the vector of coefficients.
21 this_coeff = this_coeff * (1 / (xj - xi));
24 coefficients(end+1) = this_coeff;