Computing ratio of two sums

52 Views Asked by At

I'm interested in computing

$$ f(s) := \frac{ \sum_{n=0}^{\infty} a_n s^n } { \sum_{n=0}^{\infty} b_n s^n } $$

for some given $s \in \mathbb{C}$, where the power series in the numerator and denominator diverge at $s$ but $f(s)$ still converges at $s$. Or, roughly speaking, the infinities for $a_n$ and $b_n$ cancel at $s$.

Formally speaking, if we take

$$ f_N(s) := \frac{ \sum_{n=0}^{N} a_n s^n } { \sum_{n=0}^{N} b_n s^n } $$

to be some sort of partial approximation, then

$$\lim_{N \to \infty} f_N(s) = f(s)$$

and I'm interested in computing, say $f_{128}(s)$ as a numerical approximation of $f(s)$.

If I naively sum the numerator and denominator to some given number of terms I lose a lot of precision, as the very large terms swamp the smaller terms. Is there another way to compute $f(s)$ that would do a better job of preserving precision? I expect the ratio of $\frac{a_n}{b_n}$ to be fairly well behaved, even if $a_n, b_n$ individually blow up.