Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the larger of the two final 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm |
elemental function max_final_real128(agm) result(max_final) !! Extract the final arithmetic-geometric mean from completed AGM calculations. !! Specifically, this function returns the larger of the two final 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. !! @endwarning type(arithmetic_geometric_mean_real128_type), intent(in) :: agm real(real128) :: max_final max_final = max(agm, agm%n_iter_) end function max_final_real128