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)) == f[xs]. Used to solve linear systems.
20 this_coeff = this_coeff * (1 / (xj - xi));
23 coefficients(end+1) = this_coeff;