# numeric::gaussAGM

Gauss' arithmetic geometric mean

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```numeric::gaussAGM(`a`, `b`)
```

## Description

`numeric::gaussAGM(a, b)` computes the arithmetic geometric mean of the numbers a and b.

The iteration

with the starting values a0 = a, b0 = b converges quadratically to some value . This limit is called Gauss' arithmetic geometric mean of the starting values a, b.

If both arguments a and b can be converted to real or complex floating-point numbers, then a floating point value is computed and returned. Otherwise, the symbolic call ```numeric::gaussAGM(a, b)``` is returned.

If a = 0 or b = 0 or a + b = 0, then 0.0 is returned, even if a or b are symbolic objects.

The following relation to elliptic integrals holds for all complex values a and b:

`$\text{numeric::gaussAGM}\left(a,b\right)=\frac{\pi }{4}\frac{a+b}{\text{ellipticK}\left(\frac{{\left(a-b\right)}^{2}}{{\left(a+b\right)}^{2}}\right)}$`

## Environment Interactions

The function is sensitive to the environment variable `DIGITS`.

## Examples

### Example 1

A floating-point number is returned if the arguments can be converted to floating-point numbers:

`numeric::gaussAGM(0, 5)`
``` ```
`numeric::gaussAGM(sqrt(2), PI)`
``` ```
`numeric::gaussAGM(-10, PI)`
``` ```
`numeric::gaussAGM(1 + I, 1 + 2*I)`
``` ```

A symbolic call is returned if one of the arguments cannot be converted to a float:

`numeric::gaussAGM(1, b)`
``` ```

For the special cases a = 0, b = 0 and a + b = 0, the result 0.0 is returned even for symbolic arguments:

`numeric::gaussAGM(a, 0)`
``` ```
`numeric::gaussAGM(a, -a)`
``` ```

## Parameters

 `a`, `b` arithmetical expressions

## Return Values

Floating point number or a symbolic call ```numeric::gaussAGM(a, b)```.