Polynomial Multipoint Evaluation & Fast Interpolation
Polynomial Multipoint Evaluation
Description
Given a polynomial \(f\left(x\right)\) and \(n\) points \(x_{1},x_{2},\dots,x_{n}\), compute
Solution
Consider using divide and conquer to halve the problem size.
Divide the given points into two parts:
Construct the polynomial
Then \(\forall x\in X_{0}:g_{0}\left(x\right)=0\).
Consider expressing \(f\left(x\right)\) in the form \(g_{0}\left(x\right)Q\left(x\right)+f_{0}\left(x\right)\), i.e.:
Then \(\forall x\in X_{0}:f\left(x\right)=g_{0}\left(x\right)Q\left(x\right)+f_{0}\left(x\right)=f_{0}\left(x\right)\). The same applies to \(X_{1}\).
Thus, the problem size is halved, and can be solved using divide and conquer with polynomial modulo.
Time Complexity
Fast Polynomial Interpolation
Description
Given a set of \(n+1\) points
find an \(n\)-degree polynomial \(f\left(x\right)\) such that \(\forall\left(x,y\right)\in X:f\left(x\right)=y\).
Solution
Consider the Lagrange interpolation formula
Let polynomial \(M(x) = \prod_{i=1}^n (x - x_i)\). By L'Hôpital's rule,
Thus the polynomial can be expressed as
We first compute the coefficient representation of \(M(x)\) via divide and conquer. Then all \(M'(x_i)\) can be computed in \(O(n\log^2 n)\) time via multipoint evaluation.
Let \(v_i = \frac{y_i}{M'(x_i)}\). Next, consider computing \(f(x)\). For the case \(n = 1\), we have \(f(x) = v_1, M(x) = x - x_1\). Otherwise, let
We obtain \(f(x) = f_0(x)M_1(x) + f_1(x)M_0(x), M(x) = M_0(x)M_1(x)\). Therefore, it can be computed via divide and conquer, and this part also has complexity \(O(n\log^2 n)\).
本页面最近更新:,更新历史
发现错误?想一起完善? 在 GitHub 上编辑此页!
本页面贡献者:OI-wiki
本页面的全部内容在 CC BY-SA 4.0 和 SATA 协议之条款下提供,附加条款亦可能应用