E.V.E  0.1-beta

◆ sqrt_2o_2

eve::sqrt_2o_2 = {}
inlineconstexpr

Callable object computing the halfed square root of 2 value.

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

Member Effect
operator() Computes the sqrt_2o_2 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::sqrt_2o_2(as<T>()) is semantically equivalent to eve::sqrt(T(2)/2


Example

See it live on Compiler Explorer

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