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

◆ sqrteps

auto eve::sqrteps = functor<sqrteps_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<eve::floating_value T> constexpr T sqrteps(as<T> x) noexcept;
}
constexpr auto sqrteps
Computes the square root of the machine epsilon.
Definition sqrteps.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::sqrteps(as<T>()) is semantically equivalent to 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_sqrteps() { return eve::sqrteps(eve::as<T>{}); }
int main()
{
wide_ft wxf;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> sqrteps(as<wide_ft>()) = " << eve::sqrteps(eve::as<wide_ft>()) << std::endl
<< "-> sqrteps(as(wxf)) = " << eve::sqrteps(eve::as(wxf)) << std::endl
<< "-> sqrteps[upper](as(wxf)) = " << eve::sqrteps[eve::upper](eve::as(wxf)) << std::endl
<< "-> sqrt(double(eve::eps(as<float>()))) = " << eve::sqrt(double(eve::eps(eve::as<float>()))) << std::endl
<< "-> sqrteps[lower](as(wxf)) = " << eve::sqrteps[eve::lower](eve::as(wxf)) << std::endl;
double xf;
std::cout << "---- scalar" << std::endl
<< "-> sqrteps(as<float>()) = " << eve::sqrteps(eve::as(float())) << std::endl
<< "-> sqrteps(as<xf)) = " << eve::sqrteps(eve::as(xf)) << std::endl;
std::cout << "-> constexpr sqrteps = " << constexpr_sqrteps<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