x² − 2 = 0,x₀ = 1 出发 4 步收敛到 √2 ≈ 1.4142135624 对 x² − 2 用牛顿法每步正确位数翻倍:1 → 1.5 → 1.4166667 → 1.4142157 → 1.4142135624,此时 |f| 降至 1e-10 以下。未填导数时,数值中心差分能以机器精度复现解析切线 2x。Newton–Raphson root finding
f(x) = x^2 - 2
f'(x): numeric central difference (h ≈ 1e-7)
Start: x₀ = 1, tolerance = 1e-10, max iterations = 50
Iterations:
k x_k f(x_k)
0 1 -1
1 1.5 0.25
2 1.4166666667 0.0069444444
3 1.4142156863 0.0000060073
4 1.4142135624 0
Converged after 4 iterations
Root: x ≈ 1.4142135624
|f(root)| ≈ 4.5e-12
cos(x) − x = 0 → Dottie 数 0.7390851332 用解析导数 −sin(x) − 1 求 cos(x) 的不动点:从 x₀ = 1 出发迭代以二次速度收敛到 0.7390851332151607,共 4 步——即 Dottie 数。Newton–Raphson root finding
f(x) = cos(x) - x
f'(x): analytic (-sin(x) - 1)
Start: x₀ = 1, tolerance = 1e-10, max iterations = 50
Iterations:
k x_k f(x_k)
0 1 -0.4596976941
1 0.7503638678 -0.0189230738
2 0.7391128909 -0.0000464559
3 0.7390851334 -3e-10
4 0.7390851332 0
Converged after 4 iterations
Root: x ≈ 0.7390851332
|f(root)| ≈ 0.0e+0