假设有一个点集[x0, x1, x2, ..., xn],对应的函数值为[y0, y1, y2, ..., yn],怎样求差商(1至n阶)。
k阶差商计算公式
f(x0, x1, ..., xk) = (f(x1, x2, ..., xk) - f(x0, x1, ... x(k-1))) / (xk - x0)
举个例子,一阶差商:
f(x0, x1) = (f(x1) - f(x0)) / (x1 - x0)
f(x1, x2) = (f(x2) - f(x1)) / (x2 - x1)
二阶差商:
f(x0, x1, x2) = (f(x1, x2) - f(x0, x1)) / (x2 - x1)