Arithmetic–Geometric Mean Iterates

Approximate the arithmetic–geometric mean of two finite nonnegative values with the requested number of iterations, returning both final iterates and limiting work to 128 iterations.

Description

The arithmetic–geometric mean repeatedly replaces two nonnegative values with their arithmetic and geometric means.

The arithmetic–geometric mean repeatedly replaces two nonnegative values with their arithmetic and geometric means. The two iterates approach a common limit for positive inputs.1

The tool returns value, geometric. The indexing and output conventions below determine how to read these values.

When to use Arithmetic–Geometric Mean Iterates

Use this for the following task: Approximate the arithmetic–geometric mean of two finite nonnegative values with the requested number of iterations, returning both final iterates and limiting work to 128 iterations. Use the input and output conventions below to reproduce the intended mathematical quantity.

How to use Arithmetic–Geometric Mean Iterates and understand its results

  1. Choose the required indexes, integers or sequence entries. Preserve decimal-string encodings where the field table specifies strings.
  2. Enter first, second, iterations according to the field table, then run the tool.
  3. Read value, geometric. Use the stated units, indexing and interpretation of the numerical result.
  4. Keep exact decimal strings for subsequent integer arithmetic; distinguish them from any explicitly approximate numeric result.
Input fieldMeaningValue type and boundsRequirement
firstFirst nonnegative valuenumber; minimum 0Required
secondSecond nonnegative valuenumber; minimum 0Required
iterationsMean iteration count (resource limit 128)integer; minimum 0; maximum 128Required

Order the starting values, perform the requested 0–128 iterations and return the final arithmetic value and geometric value. Use split sums and square-root products when direct operations overflow or underflow.

aₙ₊₁=(aₙ+gₙ)/2; gₙ₊₁=√(aₙgₙ)

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
valueFinal arithmetic iteratenumber
geometricFinal geometric iteratenumber
json
{
  "input": {
    "first": 4,
    "second": 1,
    "iterations": 1
  },
  "output": {
    "value": 2.5,
    "geometric": 2
  }
}

Limitations and assumptions

Zero iterations returns the sorted inputs rather than the limiting mean. The result uses floating point, stops early at equality and provides no independent convergence tolerance.

Use the declared integer bounds and string formats. Large exact outputs remain decimal strings; numerical approximations use ordinary floating-point arithmetic. A rejected input is different from a valid zero count or false membership flag.

Alternative or Complementary methods

Choose Pi from Viète’s Product when you need its operation: Approximate π by 2∏(j=1…m)2/a_j with a₁=√2 and a_(j+1)=√(2+a_j), including the empty product two and a 10,000-term resource limit. Choose Euler’s Number from the Factorial Series for the complementary operation: Approximate e by summing the first requested terms of Σ1/k!, beginning with k=0, using compensated floating-point addition and a 10,000-term resource limit.

Background reference: Digital Library of Mathematical Functions, §19.8.

References

  1. Digital Library of Mathematical Functions, §19.8 — National Institute of Standards and Technology

Similar or alternative tools

  • Pi from Viète’s Product

    Approximate π by 2∏(j=1…m)2/a_j with a₁=√2 and a_(j+1)=√(2+a_j), including the empty product two and a 10,000-term resource limit.

  • Euler’s Number from the Factorial Series

    Approximate e by summing the first requested terms of Σ1/k!, beginning with k=0, using compensated floating-point addition and a 10,000-term resource limit.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies