拉格朗日插值法
作者:互联网
\(n^2\) 暴力插值:
\(f(k) = \sum^n_{i=1} y_i \cdot \prod_{j \neq i} \frac{k - x_j}{x_i - x_j}\)
横坐标连续时,可 \(O(n)\) 插值:
\(qz_i = \prod^i_{j=0} (k - j)\)
\(hz_i = \prod^n_{j=i} (k - j)\)
\(f(k) = \sum^n_{i=1} y_i \cdot \frac{qz_{i - 1} \times hz_{i+1}}{(i - 1)! (n - i)!}\)
求 \(i^k\) :
设 \(qzik_i = \sum_{w=1}^i w^k\)
\(f(k) = \sum^{k+2}_{i=1} qzik_i \cdot \frac{qz_{i - 1} \times hz_{i+1}}{(-1)^{(k-i) \& 1}(i - 1)! (k + 2 - i)!}\)
标签:hz,拉格朗,frac,插值法,sum,qz,cdot,prod 来源: https://www.cnblogs.com/BrotherCall/p/15409304.html