min_selectable_real128 Function

private elemental function min_selectable_real128(agm, i) result(min_selectable)

Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the smaller of the two values.

Warning

This function assumes the AGM computation has been performed via the compute method.
If called on an uninitialized or improperly computed AGM object, the result may be NaN or undefined.

The iteration index i must be valid: 0 <= i <= n_iter.
No bounds checking is performed; invalid indices may cause undefined behavior.

Arguments

Type IntentOptional Attributes Name
type(arithmetic_geometric_mean_real128_type), intent(in) :: agm
integer, intent(in) :: i

Return Value real(kind=real128)


Source Code

    elemental function min_selectable_real128(agm, i) result(min_selectable)
        !! Extract the arithmetic-geometric mean value at a specific iteration.  
        !! Specifically, this function returns the smaller of the two values.
        !!
        !! @warning
        !! This function assumes the AGM computation has been performed via the `compute` method.  
        !! If called on an uninitialized or improperly computed AGM object,
        !! the result may be NaN or undefined.
        !!
        !! The iteration index `i` must be valid: `0 <= i <= n_iter`.  
        !! No bounds checking is performed; invalid indices may cause undefined behavior.
        !! @endwarning

        type(arithmetic_geometric_mean_real128_type), intent(in) :: agm

        integer, intent(in) :: i



        real(real128) :: min_selectable



        min_selectable = min( agm%list_a(i), agm%list_g(i) )

    end function min_selectable_real128