Binary splitting (source code)

= Binary splitting

Binary splitting evaluates a finite rational sum or a hypergeometric series by recursively dividing its term range into two nearly equal parts and combining exact integer data. The resulting balanced recursion tree postpones high-precision divisions and can exploit fast multiplication of similarly sized integers.

For ordinary rational partial sums represented by $(P,Q)$ and $(R,S)$, the exact merge is
$$
\frac PQ+\frac RS=\frac{PS+RQ}{QS}.
$$
For example, merging $1/2+1/3=5/6$ and $1/5+1/7=12/35$ yields $(5\cdot35+12\cdot6)/(6\cdot35)=247/210$. Hypergeometric applications additionally carry products of successive-term ratio numerators and denominators to avoid rebuilding them at every node.

In the <Chudnovsky algorithm>, this organization makes large integer arithmetic efficient while evaluating the rational partial sum exactly before the final conversion and square-root factors. It does not bound the omitted infinite tail or floating-point rounding by itself: those need separate error estimates. The benefit is the balanced arithmetic organization, not a change in the value of the series.