is_not_converged Interface

private interface is_not_converged

Check if the arithmetic-geometric mean iteration has not yet converged.

Note

Convergence criterion
Returns .true. if the absolute difference between the arithmetic mean a and geometric mean g exceeds the machine epsilon relative to the smaller value, as determined by spacing(min(a, g)).

Mathematically: |a - g| > spacing(min(a, g))

Appendix
This interface is designed for internal use within the AGM iteration where both values are guaranteed to be positive and converging.


Module Procedures

private elemental function is_not_converged_real32(a, g) result(stat)

Check if the arithmetic-geometric mean iteration has not yet converged.

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 logical

private elemental function is_not_converged_real64(a, g) result(stat)

Check if the arithmetic-geometric mean iteration has not yet converged.

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 logical

private elemental function is_not_converged_real128(a, g) result(stat)

Check if the arithmetic-geometric mean iteration has not yet converged.

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 logical