E.V.E  0.1-beta

◆ twoopi

eve::twoopi = {}
inlineconstexpr

Callable object computing the \(2/\pi\) value.

Required header: #include <eve/function/twoopi.hpp>

Member Effect
operator() Computes the twoopi constant

tempate < floating_value T > T operator()( as<T> const & t) const noexcept;
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

t: Type wrapper instance embedding the type of the constant.

Return value

the call eve::twoopi(as<T>()) is semantically equivalent to eve::rec(2*eveatan(T(1)))


Example

See it live on Compiler Explorer

#include <eve/constant/twoopi.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::endl
<< "-> twoopi(as<wide_ft>()) = " << eve::twoopi(eve::as<wide_ft>()) << std::endl
<< "-> twoopi(as(wxf)) = " << eve::twoopi(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> twoopi(as<float>()) = " << eve::twoopi(eve::as(float())) << std::endl
<< "-> twoopi(as<xf)) = " << eve::twoopi(eve::as(xf)) << std::endl;
return 0;
}
constexpr callable_twoopi_ twoopi
Callable object computing the value.
Definition: twoopi.hpp:53
Wrapper for SIMD registers.
Definition: wide.hpp:65