E.V.E  0.1-beta

◆ pio_4

eve::pio_4 = {}
inlineconstexpr

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

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

Member Effect
operator() Computes the pio_4 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::pio_4(as<T>()) is semantically equivalent to eve::atan(T(1))


Example

See it live on Compiler Explorer

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