Callable object computing the geometric mean of the inputs. \( \left(\prod_{i = 1}^n
x_i\right)^{1/n} \).
#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <vector>
#include <iostream>
int main()
{
w_t
pi = {3, 2, 3, -3}, qi = {4, 2, 1, -100};
std::cout << "---- simd" << '\n'
<<
" <- pi = " <<
pi <<
'\n'
<< " <- qi = " << qi << '\n'
float xi = 3, yi = 4;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " yi = " << yi << '\n'
w_t pf = {3, 1, -3, -10}, qf = {4, 1, 1, 15};;
std::cout << "---- multi" << '\n'
<< " <- pf = " << pf << '\n'
<< " <- qf = " << qf << '\n'
<<
" -> geommean(1.0f, qf, pf, 32.0f) = " <<
eve::geommean(1.0f, qf, pf, 32.0f) <<
'\n'
<<
" -> geommean(1.0f, qf, pf, 32.0f) = " <<
eve::geommean(1.0f, qf, pf, 32.0f) <<
'\n'
<<
" -> geommean(-1.0f, qf, pf) = " <<
eve::geommean(-1.0f, qf, pf) <<
'\n';
return 0;
}
constexpr callable_pi_ pi
Callable object computing the constant .
Definition: pi.hpp:49
Wrapper for SIMD registers.
Definition: wide.hpp:65