The divided differences can be calculated using the following formula:
f[x0] = f(x0)
f[x0, x1] = (f[x1] - f[x0]) / (x1 - x0)
f[x0, x1, x2] = (f[x1, x2] - f[x0, x1]) / (x2 - x0)
f[x0, x1, x2, x3] = (f[x1, x2, x3] - f[x0, x1, x2]) / (x3 - x0)
f[x0, x1, x2, x3, x4]
Show more…