Computes the arithmetic-geometric mean.
{
template< eve::floating_value T, eve::floating_value U >
eve::common_compatible_t<T, U>
agm(T x, U y)
noexcept;
}
constexpr callable_agm_ agm
Computes the arithmetic-geometric mean.
Definition: agm.hpp:61
Definition: all_of.hpp:22
The value of the arithmetic-geometric mean is returned. No overflow can occur. The two parameters must share the same sign.
#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <vector>
#include <iostream>
int main()
{
wf_t pf = {3, 2, 3, 3};
std::cout << "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " <- qf = " << qf << '\n'
<<
" -> agm(pf, qf) = " <<
eve::agm(pf, qf) <<
'\n';
double xi = 3, yi = 4;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
<<
" -> agm(xi, yi) = " <<
eve::agm(xi, yi) <<
'\n';
return 0;
}
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65