Safe Haskell | None |
---|

`AUTHOR`

- Dr. Alistair Ward
`DESCRIPTION`

- Determines the
*Arithmetic-geometric mean*; http://en.wikipedia.org/wiki/Arithmetic-geometric_mean.

- type ArithmeticMean = Rational
- type GeometricMean = Rational
- type AGM = (ArithmeticMean, GeometricMean)
- convergeToAGM :: Algorithmic squareRootAlgorithm => squareRootAlgorithm -> DecimalDigits -> AGM -> [AGM]
- spread :: AGM -> Rational
- getArithmeticMean :: AGM -> ArithmeticMean
- getGeometricMean :: AGM -> GeometricMean
- isValid :: AGM -> Bool

# Types

## Type-synonyms

type ArithmeticMean = RationalSource

The type of the *arithmetic mean*; http://en.wikipedia.org/wiki/Arithmetic_mean.

type GeometricMean = RationalSource

The type of the *geometric mean*; http://en.wikipedia.org/wiki/Geometric_mean.

type AGM = (ArithmeticMean, GeometricMean)Source

Encapsulates both *arithmetic* and *geometric* means.

# Functions

convergeToAGM :: Algorithmic squareRootAlgorithm => squareRootAlgorithm -> DecimalDigits -> AGM -> [AGM]Source

Returns an infinite list which converges on the *Arithmetic-geometric mean*.

## Accessors

getArithmeticMean :: AGM -> ArithmeticMeanSource

Accessor.

getGeometricMean :: AGM -> GeometricMeanSource

Accessor.