Compute arithmetic–geometric mean.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | initial_n_iter | = | -1 | |
| integer, | private, | parameter | :: | max_n_iter_real128 | = | digits(0.0_real128) | |
| integer, | private, | parameter | :: | max_n_iter_real32 | = | digits(0.0_real32) | |
| integer, | private, | parameter | :: | max_n_iter_real64 | = | digits(0.0_real64) |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
This interface performs lightweight AGM computation with input validation, automatic ordering. Unlike the type-bound subroutine instead, this interface does not retain intermediate calculation results, so they cannot be referenced later.
Note
x and y had opposite signs (x * y .lt. 0): returns NaNx or y is zero (x * y .eq. 0): returns 0Safe wrapper for the arithmetic-geometric mean (AGM) computation.
This function performs lightweight AGM computation with input validation, automatic ordering. Unlike the type-bound subroutine compute_real32 instead, this function does not retain intermediate calculation results, so they cannot be referenced later.
Note
x and y had opposite signs (x * y .lt. 0): returns NaNx or y is zero (x * y .eq. 0): returns 0| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | x | |||
| real(kind=real32), | intent(in) | :: | y |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
This function performs lightweight AGM computation with input validation, automatic ordering. Unlike the type-bound subroutine compute_real64 instead, this function does not retain intermediate calculation results, so they cannot be referenced later.
Note
x and y had opposite signs (x * y .lt. 0): returns NaNx or y is zero (x * y .eq. 0): returns 0| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x | |||
| real(kind=real64), | intent(in) | :: | y |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
This function performs lightweight AGM computation with input validation, automatic ordering. Unlike the type-bound subroutine compute_real128 instead, this function does not retain intermediate calculation results, so they cannot be referenced later.
Note
x and y had opposite signs (x * y .lt. 0): returns NaNx or y is zero (x * y .eq. 0): returns 0| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | x | |||
| real(kind=real128), | intent(in) | :: | y |
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
Note
Convergence criterion
See is_not_converged
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean a and geometric mean g.
This function 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 compute_kernel_real32 instead,
which preserves the full iteration history.
Warning
Note
Convergence criterion
See is_not_converged
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | g |
geometric mean |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean a and geometric mean g.
This function 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 compute_kernel_real64 instead,
which preserves the full iteration history.
Warning
Note
Convergence criterion
See is_not_converged
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | g |
geometric mean |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean a and geometric mean g.
This function 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 compute_kernel_real128 instead,
which preserves the full iteration history.
Warning
Note
Convergence criterion
See is_not_converged
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | g |
geometric mean |
Compute arithmetic and geometric mean using the given prev_a and prev_g.
Warning
Compute arithmetic and geometric mean using the given prev_a and prev_g.
Warning
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | prev_a |
previous arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | prev_g |
previous geometric mean |
||
| real(kind=real32), | intent(out) | :: | next_a |
next arithmetic mean |
||
| real(kind=real32), | intent(out) | :: | next_g |
next geometric mean |
Compute arithmetic and geometric mean using the given prev_a and prev_g.
Warning
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | prev_a |
previous arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | prev_g |
previous geometric mean |
||
| real(kind=real64), | intent(out) | :: | next_a |
next arithmetic mean |
||
| real(kind=real64), | intent(out) | :: | next_g |
next geometric mean |
Compute arithmetic and geometric mean using the given prev_a and prev_g.
Warning
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | prev_a |
previous arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | prev_g |
previous geometric mean |
||
| real(kind=real128), | intent(out) | :: | next_a |
next arithmetic mean |
||
| real(kind=real128), | intent(out) | :: | next_g |
next geometric mean |
Extract the final gap (arithmetic mean - geometric mean).
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_real32_type), | intent(in) | :: | agm |
Extract the final gap (arithmetic mean - geometric mean).
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_real64_type), | intent(in) | :: | agm |
Extract the final gap (arithmetic mean - geometric mean).
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 |
Extract the gap (arithmetic mean - geometric mean) at a specific iteration.
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the gap (arithmetic mean - geometric mean) at a specific iteration.
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the gap (arithmetic mean - geometric mean) at a specific iteration.
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Initialize components: n_iter, list_a and list_g
Initialize components: n_iter, list_a and list_g
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(inout) | :: | agm |
Initialize components: n_iter, list_a and list_g
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(inout) | :: | agm |
Initialize components: n_iter, list_a and list_g
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(inout) | :: | agm |
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.
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 function is designed for internal use within the AGM iteration where
both values are guaranteed to be positive and converging.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | g |
geometric mean |
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 function is designed for internal use within the AGM iteration where
both values are guaranteed to be positive and converging.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | g |
geometric mean |
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 function is designed for internal use within the AGM iteration where
both values are guaranteed to be positive and converging.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | g |
geometric mean |
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_real32_type), | intent(in) | :: | agm |
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_real64_type), | intent(in) | :: | agm |
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 |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger 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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the smaller 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_real32_type), | intent(in) | :: | agm |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the smaller 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_real64_type), | intent(in) | :: | agm |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the smaller 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 |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | n_iter_ | = | initial_n_iter |
the number of iterations performed during AGM calculation |
| procedure, public, pass :: n_iter |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real128), | private | :: | list_a(0:max_n_iter_real128) |
history of the arithmetic mean |
|||
| real(kind=real128), | private | :: | list_g(0:max_n_iter_real128) |
history of the geometric mean |
| generic, public :: compute => compute_real128 | |
| generic, private :: compute_kernel => compute_kernel_real128 | |
| procedure, private, pass :: compute_kernel_real128 | |
| procedure, private, pass :: compute_real128 | |
| procedure, public, pass :: n_iter |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real32), | private | :: | list_a(0:max_n_iter_real32) |
history of the arithmetic mean |
|||
| real(kind=real32), | private | :: | list_g(0:max_n_iter_real32) |
history of the geometric mean |
| generic, public :: compute => compute_real32 | |
| generic, private :: compute_kernel => compute_kernel_real32 | |
| procedure, private, pass :: compute_kernel_real32 | |
| procedure, private, pass :: compute_real32 | |
| procedure, public, pass :: n_iter |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=real64), | private | :: | list_a(0:max_n_iter_real64) |
history of the arithmetic mean |
|||
| real(kind=real64), | private | :: | list_g(0:max_n_iter_real64) |
history of the geometric mean |
| generic, public :: compute => compute_real64 | |
| generic, private :: compute_kernel => compute_kernel_real64 | |
| procedure, private, pass :: compute_kernel_real64 | |
| procedure, private, pass :: compute_real64 | |
| procedure, public, pass :: n_iter |
return the number of iterations performed during AGM calculation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_base_type), | intent(in) | :: | agm |
Check if the arithmetic-geometric mean iteration has not yet converged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | g |
geometric mean |
Check if the arithmetic-geometric mean iteration has not yet converged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | g |
geometric mean |
Check if the arithmetic-geometric mean iteration has not yet converged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | g |
geometric mean |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean a and geometric mean g.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | g |
geometric mean |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | x | |||
| real(kind=real128), | intent(in) | :: | y |
Extract the final gap (arithmetic mean - geometric mean).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm |
Extract the gap (arithmetic mean - geometric mean) at a specific iteration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the larger of the two final values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger of the two values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the smaller of the two final values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the smaller of the two values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean a and geometric mean g.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | g |
geometric mean |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | x | |||
| real(kind=real32), | intent(in) | :: | y |
Extract the final gap (arithmetic mean - geometric mean).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm |
Extract the gap (arithmetic mean - geometric mean) at a specific iteration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the larger of the two final values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger of the two values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the smaller of the two final values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the smaller of the two values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean a and geometric mean g.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | a |
arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | g |
geometric mean |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | x | |||
| real(kind=real64), | intent(in) | :: | y |
Extract the final gap (arithmetic mean - geometric mean).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm |
Extract the gap (arithmetic mean - geometric mean) at a specific iteration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the larger of the two final values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the larger of the two values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Extract the final arithmetic-geometric mean from completed AGM calculations.
Specifically, this function returns the smaller of the two final values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm |
Extract the arithmetic-geometric mean value at a specific iteration.
Specifically, this function returns the smaller of the two values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(in) | :: | agm | |||
| integer, | intent(in) | :: | i |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean init_a and geometric mean init_g
and store the complete iteration history.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_real128_type), | intent(inout) | :: | agm | |||
| real(kind=real128), | intent(in) | :: | init_a |
initial value: arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | init_g |
initial value: geometric mean |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean init_a and geometric mean init_g
and store the complete iteration history.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_real32_type), | intent(inout) | :: | agm | |||
| real(kind=real32), | intent(in) | :: | init_a |
initial value: arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | init_g |
initial value: geometric mean |
Compute arithmetic–geometric mean (AGM)
using the given arithmetic mean init_a and geometric mean init_g
and store the complete iteration history.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_real64_type), | intent(inout) | :: | agm | |||
| real(kind=real64), | intent(in) | :: | init_a |
initial value: arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | init_g |
initial value: geometric mean |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_real128_type), | intent(inout) | :: | agm | |||
| real(kind=real128), | intent(in) | :: | x | |||
| real(kind=real128), | intent(in) | :: | y |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_real32_type), | intent(inout) | :: | agm | |||
| real(kind=real32), | intent(in) | :: | x | |||
| real(kind=real32), | intent(in) | :: | y |
Safe wrapper for the arithmetic-geometric mean (AGM) computation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(arithmetic_geometric_mean_real64_type), | intent(inout) | :: | agm | |||
| real(kind=real64), | intent(in) | :: | x | |||
| real(kind=real64), | intent(in) | :: | y |
Compute arithmetic and geometric mean using the given prev_a and prev_g.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real128), | intent(in) | :: | prev_a |
previous arithmetic mean |
||
| real(kind=real128), | intent(in) | :: | prev_g |
previous geometric mean |
||
| real(kind=real128), | intent(out) | :: | next_a |
next arithmetic mean |
||
| real(kind=real128), | intent(out) | :: | next_g |
next geometric mean |
Compute arithmetic and geometric mean using the given prev_a and prev_g.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in) | :: | prev_a |
previous arithmetic mean |
||
| real(kind=real32), | intent(in) | :: | prev_g |
previous geometric mean |
||
| real(kind=real32), | intent(out) | :: | next_a |
next arithmetic mean |
||
| real(kind=real32), | intent(out) | :: | next_g |
next geometric mean |
Compute arithmetic and geometric mean using the given prev_a and prev_g.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in) | :: | prev_a |
previous arithmetic mean |
||
| real(kind=real64), | intent(in) | :: | prev_g |
previous geometric mean |
||
| real(kind=real64), | intent(out) | :: | next_a |
next arithmetic mean |
||
| real(kind=real64), | intent(out) | :: | next_g |
next geometric mean |
Initialize components: n_iter, list_a and list_g
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real128_type), | intent(inout) | :: | agm |
Initialize components: n_iter, list_a and list_g
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real32_type), | intent(inout) | :: | agm |
Initialize components: n_iter, list_a and list_g
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(arithmetic_geometric_mean_real64_type), | intent(inout) | :: | agm |