数学逻辑
在 Chudnovsky
的基础上使用 Binary splitting
(一种加速各种有理项级数数值计算的技术)计算
现有以下一般无穷级数的模型
S(0,∞)=b0q0a0p0+b1q0q1a1p0p1+b2q0q1q2a2p0p1p2+b3q0q1q2q3a3p0p1p2p3+⋯该级数的部分和 [a,b)
S(a,b)=baqaaapa+ba+1qaqa+1aa+1papa+1+ba+2qaqa+1qa+2aa+2papa+1pa+2+⋯+bb−1qaqa+1⋯pb−1ab−1papa+1pa+2⋯pb−1定义一些额外的函数
P(a,b)Q(a,b)B(a,b)T(a,b)=papa+1⋯pb−1=qaqa+1⋯qb−1=baba+1⋯bb−1=B(a,b)Q(a,b)S(a,b)-
则存在以下关系
P(a,a+1)Q(a,a+1)B(a,a+1)S(a,a+1)T(a,a+1)=pa=qa=ba=baqaaapa=B(a,a+1)Q(a,a+1)S(a,a+1)=baqabaqaaapa=aapa -
若 a<=m<=b 则
P(a,b)Q(a,b)B(a,b)T(a,b)=P(a,m)P(m,b)=Q(a,m)Q(m,b)=B(a,m)B(m,b)=B(m,b)Q(m,b)T(a,m)+B(a,m)P(a,m)T(m,b)-
其中 T(a,b) 的证明
T(a,b)=B(m,b)Q(m,b)T(a,m)+B(a,m)P(a,m)T(m,b)=B(m,b)Q(m,b)B(a,m)Q(a,m)S(a,m)+B(a,m)P(a,m)B(m,b)Q(m,b)S(m,b)=B(a,b)Q(a,b)S(a,m)+B(a,b)P(a,m)Q(m,b)S(m,b)=B(a,b)(Q(a,b)S(a,m)+Q(a,m)P(a,m)Q(a,b)S(m,b))=B(a,b)Q(a,b)(baqaaapa+ba+1qaqa+1aa+1papa+1+ba+2qaqa+1qa+2aa+2papa+1pa+2+⋯+bm−1qaqa+1⋯pm−1am−1papa+1pa+2⋯pm−1+qaqa+1⋯qm−1papa+1⋯pm−1⋅(bmqmampm+bm+1qmqm+1am+1pmpm+1+bm+2qmqm+1qm+2am+2pmpm+1pm+2+⋯+bb−1qmqm+1⋯pb−1ab−1pmpm+1pm+2⋯pb−1))=B(a,b)Q(a,b)(baqaaapa+ba+1qaqa+1aa+1papa+1+ba+2qaqa+1qa+2aa+2papa+1pa+2+⋯+bm−1qaqa+1⋯pm−1am−1papa+1pa+2⋯pm−1+qaqa+1⋯qm−1papa+1⋯pm−1+bmqaqa+1⋯qmampapa+1⋯pm+bm+1qaqa+1⋯qm+1am+1papa+1⋯pm+1+bm+2qaqa+1⋯qm+2am+2papa+1⋯pm+2+⋯+bb−1qaqa+1⋯p_b−1ab−1papa+1⋯pb−1)=B(a,b)Q(a,b)S(a,b)=T(a,b)
-
现在我们计算 S(0,n),可以按照如下方式二分迭代计算(m=⌊20+n⌋)。这样在计算结束时只进行一次除法,这会大大加快计算速度,因为除法比乘法慢。
S(0,n)=B(0,n)Q(0,n)T(0,n)=B(0,m)B(m,n)⋅Q(0,m)Q(m,n)B(m,n)Q(m,n)T(0,m)+B(0,m)P(0,m)T(m,n)=⋯回到我们待计算的级数上,忽略待计算级数 (−1)k 项,则存在以下对应关系(之前的递推关系 Ak−1Ak=qkpk)
akbkp0q0pkqk=13591409+545140134k=1=1=1=(6k−5)(2k−1)(6k−1)=24k3⋅6403203