# Fungrim entry: a2b0f9

$\left(a_{n + 1}, b_{n + 1}\right) = \left(x, s y\right)\; \text{ where } x = \frac{a_{n} + b_{n}}{2},\;y = \sqrt{a_{n} b_{n}},\;s = \begin{cases} +1, & y = 0 \;\mathbin{\operatorname{or}}\; \operatorname{Re}\!\left(\frac{x}{y}\right) \ge 0\\-1, & \text{otherwise}\\ \end{cases}\; \text{ where } \left(a_{k}, b_{k}\right) = \operatorname{agm}_{k}\!\left(a, b\right)$
Assumptions:$n \in \mathbb{Z}_{\ge 0} \;\mathbin{\operatorname{and}}\; a \in \mathbb{C} \;\mathbin{\operatorname{and}}\; b \in \mathbb{C}$
TeX:
\left(a_{n + 1}, b_{n + 1}\right) = \left(x, s y\right)\; \text{ where } x = \frac{a_{n} + b_{n}}{2},\;y = \sqrt{a_{n} b_{n}},\;s = \begin{cases} +1, & y = 0 \;\mathbin{\operatorname{or}}\; \operatorname{Re}\!\left(\frac{x}{y}\right) \ge 0\\-1, & \text{otherwise}\\ \end{cases}\; \text{ where } \left(a_{k}, b_{k}\right) = \operatorname{agm}_{k}\!\left(a, b\right)

n \in \mathbb{Z}_{\ge 0} \;\mathbin{\operatorname{and}}\; a \in \mathbb{C} \;\mathbin{\operatorname{and}}\; b \in \mathbb{C}
Definitions:
Fungrim symbol Notation Short description
Sqrt$\sqrt{z}$ Principal square root
Re$\operatorname{Re}(z)$ Real part
AGMSequence$\operatorname{agm}_{n}\!\left(a, b\right)$ Convergents in AGM iteration
ZZGreaterEqual$\mathbb{Z}_{\ge n}$ Integers greater than or equal to n
CC$\mathbb{C}$ Complex numbers
Source code for this entry:
Entry(ID("a2b0f9"),
Formula(Where(Equal(Tuple(a_(Add(n, 1)), b_(Add(n, 1))), Where(Tuple(x, Mul(s, y)), Def(x, Div(Add(a_(n), b_(n)), 2)), Def(y, Sqrt(Mul(a_(n), b_(n)))), Def(s, Cases(Tuple(Pos(1), Or(Equal(y, 0), GreaterEqual(Re(Div(x, y)), 0))), Tuple(Neg(1), Otherwise))))), Def(Tuple(a_(k), b_(k)), AGMSequence(k, a, b)))),
Variables(n, a, b),
Assumptions(And(Element(n, ZZGreaterEqual(0)), Element(a, CC), Element(b, CC))))

## Topics using this entry

Copyright (C) Fredrik Johansson and contributors. Fungrim is provided under the MIT license. The source code is on GitHub.

2021-03-15 19:12:00.328586 UTC