E.V.E  0.1-beta

◆ oneotwoeps

eve::oneotwoeps = {}
inlineconstexpr

Callable object computing half the inverse of the machine epsilon.

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

Member Effect
operator() Computes the oneotwoeps 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::oneotwoeps(eve::as<T>()) is semantically equivalent to eve::rec(2*eveeps(eve::as<T>()))


Example

See it live on Compiler Explorer

#include <eve/constant/oneotwoeps.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
using wide_it = eve::wide<std::int16_t>;
int main()
{
wide_ft wxf;
wide_it wxi;
std::cout << "---- simd" << std::endl
<< "-> oneotwoeps(as<wide_ft>()) = " << eve::oneotwoeps(eve::as<wide_ft>()) << std::endl
<< "-> oneotwoeps(as<wide_it>()) = " << eve::oneotwoeps(eve::as<wide_it>()) << std::endl
<< "-> oneotwoeps(as(wxf)) = " << eve::oneotwoeps(eve::as(wxf)) << std::endl
<< "-> oneotwoeps(as(wxi)) = " << eve::oneotwoeps(eve::as(wxi)) << std::endl;
double xf;
std::int16_t xi;
std::cout << "---- scalar" << std::endl
<< "-> oneotwoeps(as<float>()) = " << eve::oneotwoeps(eve::as(float())) << std::endl
<< "-> oneotwoeps(as<std::int16_t>()) = " << eve::oneotwoeps(eve::as(std::int16_t())) << std::endl
<< "-> oneotwoeps(as<xf)) = " << eve::oneotwoeps(eve::as(xf)) << std::endl
<< "-> oneotwoeps(as<xi)) = " << eve::oneotwoeps(eve::as(xi)) << std::endl;
return 0;
}
constexpr callable_oneotwoeps_ oneotwoeps
Callable object computing half the inverse of the machine epsilon.
Definition: oneotwoeps.hpp:55
Wrapper for SIMD registers.
Definition: wide.hpp:65