E.V.E  0.1-beta

◆ halfeps

eve::halfeps = {}
inlineconstexpr

Callable object computing the the half of the machine epsilon.

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

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


Example

See it live on Compiler Explorer

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