E.V.E
v2022.03.00

◆ oneosqrteps

eve::oneosqrteps = {}
inlineconstexpr

Computes the the inverse of the square root of the machine epsilon.

Callable object computing the inverse of the square root of the machine epsilon.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T oneosqrteps(as<T> x) noexcept;
}
constexpr callable_oneosqrteps_ oneosqrteps
Computes the the inverse of the square root of the machine epsilon.
Definition: oneosqrteps.hpp:96
Definition: all_of.hpp:22
Lightweight type-wrapper.
Definition: as.hpp:29

Parameters

  • x : Type wrapper instance embedding the type of the constant.

Return value

The call eve::oneosqrteps(as<T>()) is semantically equivalent to eve::rec (eve::sqrt (eve::eps (as<T>())))

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> oneosqrteps(as<wide_ft>()) = " << eve::oneosqrteps(eve::as<wide_ft>()) << std::endl
<< "-> oneosqrteps(as(wxf)) = " << eve::oneosqrteps(eve::as(wxf)) << std::endl
<< "-> upward(oneosqrteps)(as(wxf)) = " << eve::upward(eve::oneosqrteps)(eve::as(wxf)) << std::endl
<< "-> rec(eve::sqrt(double(eps((as<float>()))))) = " << 1.0/(eve::sqrt(double(eve::eps((eve::as<float>()))))) << std::endl
<< "-> downward(oneosqrteps)(as(wxf)) = " << eve::downward(eve::oneosqrteps)(eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> oneosqrteps(as<float>()) = " << eve::oneosqrteps(eve::as(float())) << std::endl
<< "-> oneosqrteps(as<xf)) = " << eve::oneosqrteps(eve::as(xf)) << std::endl;
return 0;
}
constexpr callable_sqrt_ sqrt
Computes the square root of the parameter.
Definition: sqrt.hpp:95
constexpr upward_type const upward
Higher-order Callable Object imbuing upward rounding semantic onto other Callable Objects.
Definition: roundings.hpp:160
constexpr downward_type const downward
Higher-order Callable Object imbuing rounding downard semantic onto other Callable Objects.
Definition: roundings.hpp:161
Wrapper for SIMD registers.
Definition: wide.hpp:65

Required header: #include <eve/module/core.hpp>

Member Effect
operator() Computes the oneosqrteps constant

template < floating_value T > T operator()( as<T> const & t) const noexcept;

Parameters

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

Return value

the call eve::oneosqrteps(as<T>()) is semantically equivalent to eve::rec(eve::sqrt(eve::eps(as<T>())))


Example