Function convergents()
returns partial convergents of the continued fraction
$$a_0+
\frac{1}{a_1+
\frac{1}{a_2+
\frac{1}{a_3+
\frac{1}{a_4+
\frac{1}{a_5+\ddots
}}}}}$$
where a
= \(a_0,a_1,a_2,\ldots\) (note the
off-by-one issue).
Function gconvergents()
returns partial convergents of the continued fraction
$$b_0+
\frac{a_1}{b_1+
\frac{a_2}{b_2+
\frac{a_3}{b_3+
\frac{a_4}{b_4+
\frac{a_5}{b_5+\ddots
}}}}}$$
where a
= \(a_1,a_2,\ldots\)