[学习笔记] 牛顿迭代

描述

已知 \(g(x)\),求 \(f(x)\) 满足 \(g(f(x)) \equiv 0 \pmod{x^n}\)

方法

倍增。

\(f_0(x)\) 满足 \(g(f_0(x)) \equiv 0 \pmod{x^{\lceil \frac{n}{2} \rceil}}\)

\(g(x)\)\(f_0(x)\) 处泰勒展开,

\[g(x) \equiv \sum_{i \ge 0}\frac{g^{(i)}(f_0(x))}{i!}(f(x) - f_0(x))^i \equiv 0 \pmod{x^n} \]

由于 \(f(x)\)\(f_0(x)\) 的前 \(\lceil \frac{n}{2} \rceil - 1\) 项相同,所以 \(\forall i \ge 2,(f(x) - f_0(x))^i \equiv 0 \pmod{x^n}\)

所以

\[g(x) \equiv g(f_0(x)) + g'(f_0(x))(f(x) - f_0(x)) \equiv 0 \pmod{x^n} \]

移项可得

\[f(x) = f_0(x) - \frac{g(f_0(x))}{g'(f_0(x))} \]

用途

\(h(x)\) 为原多项式,

求逆

\[g(f(x)) \equiv \frac{1}{f(x)} - h(x) \equiv 0 \pmod{x^n} \]

\[\begin{aligned} f(x) &\equiv f_0(x) - \frac{\frac{1}{f_0(x)} - h(x)}{-\frac{1}{f_0^2(x)}} \pmod{x^n} \\ &\equiv f_0(x) + f_0(x) - f_0^2(x)h(x) \pmod{x^n} \\ &\equiv f_0(x)(2 - f_0(x)h(x)) \pmod{x^n} \\ \end{aligned} \]

时间复杂度为 \(T(n) = T(\frac{n}{2}) + O(n\log n) = O(n \log n)\)

开方

\[g(f(x)) \equiv f_0^2(x) - h(x) \equiv 0 \pmod{x^n} \]

\[\begin{aligned} f(x) &\equiv f_0(x) - \frac{f_0^2(x) - h(x)}{2f_0(x)} \pmod{x^n} \\ &\equiv \frac{1}{2}(f_0(x) - \frac{h(x)}{f_0(x)}) \end{aligned} \]

时间复杂度为 \(O(n \log n)\)

exp

前置知识:\((\ln x)' = \frac{1}{x}\)

\[g(f(x)) \equiv \ln f(x) - h(x) \equiv 0 \pmod{x^n} \]

\[\begin{aligned} f(x) &\equiv f_0(x) - \frac{\ln f_0(x) - h(x)}{\frac{1}{f_0(x)}} \pmod{x^n} \\ &\equiv f_0(x)(1 - \ln f_0(x) + h(x)) \pmod{x^n} \end{aligned} \]

时间复杂度为 \(O(n\log n)\)

posted @ 2020-12-03 15:17  BruceW  阅读(133)  评论(1编辑  收藏  举报