E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ oneosqrteps

auto eve::oneosqrteps = functor<oneosqrteps_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::floating_value T> constexpr T oneosqrteps(as<T> x) noexcept;
}
constexpr auto oneosqrteps
Computes the the inverse of the square root of the machine epsilon.
Definition oneosqrteps.hpp:71
EVE Main Namespace.
Definition abi.hpp:18
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>;
template<typename T>
consteval auto constexpr_oneosqrteps() { return eve::oneosqrteps(eve::as<T>{}); }
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
<< "-> upper(oneosqrteps)(as(wxf)) = " << eve::oneosqrteps[eve::upper](eve::as(wxf)) << std::endl
<< "-> rec(eve::sqrt(double(eps((as<float>()))))) = " << 1.0/(eve::sqrt(double(eve::eps((eve::as<float>()))))) << std::endl
<< "-> lower(oneosqrteps)(as(wxf)) = " << eve::oneosqrteps[eve::lower](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;
std::cout << "-> constexpr oneosqrteps = " << constexpr_oneosqrteps<float>() << std::endl;
return 0;
}
constexpr auto sqrt
Computes the square root of the parameter.
Definition sqrt.hpp:80
constexpr auto eps
Computes a constant to the machine epsilon.
Definition eps.hpp:73
Wrapper for SIMD registers.
Definition wide.hpp:70