This task investigates mathmatical operations that can be performed on a single continued fraction. This requires only a baby version of NG:
: <math>\begin{bmatrix}
  a_1 & a \\
  b_1 & b
\end{bmatrix}</math>
I may perform perform the following operations:
:Input the next term of N<sub>1</sub>
:Output a term of the continued fraction resulting from the operation.

I output a term if the integer parts of <math>\frac{a}{b}</math> and <math>\frac{a_1}{b_1}</math> are equal. Otherwise I input a term from N. If I need a term from N but N has no more terms I inject <math>\infty</math>.

When I input a term t my internal state: <math>\begin{bmatrix}
  a_1 & a \\
  b_1 & b
\end{bmatrix}</math> is transposed thus <math>\begin{bmatrix} a + a_1 * t & a_1  \\
  b + b_1 * t & b_1
\end{bmatrix}</math>

When I output a term t my internal state: <math>\begin{bmatrix}
  a_1 & a \\
  b_1 & b
\end{bmatrix}</math> is transposed thus <math>\begin{bmatrix} b_1 & b  \\
  a_1 - b_1 * t & a - b * t
\end{bmatrix}</math>

When I need a term t but there are no more my internal state: <math>\begin{bmatrix}
  a_1 & a \\
  b_1 & b
\end{bmatrix}</math> is transposed thus <math>\begin{bmatrix} a_1 & a_1 \\
  b_1 & b_1
\end{bmatrix}</math>

I am done when b<sub>1</sub> and b are zero.

Demonstrate your solution by calculating:
:[1;5,2] + 1/2
:[3;7] + 1/2
:[3;7] divided by 4
Using a generator for <math>\sqrt{2}</math> (e.g., from [[Continued fraction]]) calculate <math>\frac{1}{\sqrt{2}}</math>. You are now at the starting line for using Continued Fractions to implement [[Arithmetic-geometric mean]] without ulps and epsilons.

The first step in implementing [[Arithmetic-geometric mean]] is to calculate <math>\frac{1 + \frac{1}{\sqrt{2}}}{2}</math> do this now to cross the starting line and begin the race.
