arithmetic_geometric_mean_kernel Interface

public interface arithmetic_geometric_mean_kernel

Compute arithmetic–geometric mean (AGM) using the given arithmetic mean a and geometric mean g.

This interface provides a lightweight AGM computation that returns only the final converged value without storing iteration history.
For applications that need to analyze the convergence process, use the type-bound subroutine instead, which preserves the full iteration history.

Warning

  • This interface assumes both inputs are positive.
  • No validation is performed on inputs.

Note

Convergence criterion
See is_not_converged


Module Procedures

private elemental function arithmetic_geometric_mean_kernel_real32(a, g) result(agm)

Compute arithmetic–geometric mean (AGM) using the given arithmetic mean a and geometric mean g.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real32), intent(in) :: a

arithmetic mean

real(kind=real32), intent(in) :: g

geometric mean

Return Value real(kind=real32)

private elemental function arithmetic_geometric_mean_kernel_real64(a, g) result(agm)

Compute arithmetic–geometric mean (AGM) using the given arithmetic mean a and geometric mean g.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: a

arithmetic mean

real(kind=real64), intent(in) :: g

geometric mean

Return Value real(kind=real64)

private elemental function arithmetic_geometric_mean_kernel_real128(a, g) result(agm)

Compute arithmetic–geometric mean (AGM) using the given arithmetic mean a and geometric mean g.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=real128), intent(in) :: a

arithmetic mean

real(kind=real128), intent(in) :: g

geometric mean

Return Value real(kind=real128)