关于指数函数无穷乘积公式的误差项问询
关于指数函数无穷乘积公式的误差项问询
我来帮你梳理这个无穷乘积对应的误差项相关内容哈~
首先,你给出的无穷乘积递推形式如下:
$$\prod_{k=0}na_k=\left(1\pm\frac{x}{2n}\right){\pm2n}$$
分情况的递推定义
- 当 $x \geq 0$ 时:
$$a_0=1+x,\qquad a_{n+1}=\left(1+\frac{x2}{2{n+2}(x+2n)}\right){2^n}$$ - 当 $x \leq 0$ 时:
$$a_0=\frac1{1-x},\qquad a_{n+1}=\left(1-\frac{x2}{(2{n+1}-x)2}\right){2^n}$$
误差项的数值实验
为了直观观测误差项的表现,我们可以用Python的mpmath库做高精度数值计算,代码如下:
import mpmath def exp_err(x, ipow2): n = mpmath.mpf(2)**ipow2 return mpmath.fabs(mpmath.exp(x) - (1 + x/n)**n) for x in [3, 7, 15, 31, 63]: for iprec, ipow2 in [(64, 32), (128, 64), (256, 128)]: mpmath.mp.prec = iprec err = exp_err(mpmath.mpf(x), ipow2) flog2 = mpmath.log(err, 2) print(f"# For x={x:,} and n=2**{ipow2}, the error term is 2**{round(flog2, 8)}")
运行后得到的部分输出结果:
For x=3 and n=232, the error term is 2-25.50198988For x=3 and n=264, the error term is 2-57.50198988For x=3 ...
从这些数值结果能看出,当n取2的幂次增大时,误差项在对数尺度上呈近似线性的减小趋势,大致符合 $\mathcal{O}(2^{-2n})$ 量级的收敛速率(比如x=3时,n从$2{32}$到$2{64}$,误差的log₂值从-25.5左右降到-57.5左右,接近2倍的对应关系)。
备注:内容来源于stack exchange,提问作者Axl
相关产品推荐
相关产品推荐

