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

◆ sqrt_3

auto eve::sqrt_3 = functor<sqrt_3_t>
inlineconstexpr

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T sqrt_3(as<T> x) noexcept;
}
constexpr auto sqrt_3
Callable object computing constant .
Definition sqrt_3.hpp:78
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::sqrt_3(as<T>()) returns the square root of 3.

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
using wide_dt = eve::wide<double>;
template<typename T>
consteval auto constexpr_sqrt_3() { return eve::sqrt_3(eve::as<T>{}); }
int main()
{
wide_ft wxf;
wide_dt wxd;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> sqrt_3(as<wide_ft>()) = " << eve::sqrt_3(eve::as<wide_ft>()) << std::endl
<< "-> sqrt_3(as(wxf)) = " << eve::sqrt_3(eve::as(wxf)) << std::endl
<< "-> sqrt_3[upper](as<wide_ft>()) = " << eve::sqrt_3[eve::upper](eve::as<wide_ft>()) << std::endl
<< "-> sqrt_3[upper](as(wxf)) = " << eve::sqrt_3[eve::upper](eve::as(wxf)) << std::endl
<< "-> sqrt_3[lower](as<wide_ft>()) = " << eve::sqrt_3[eve::lower](eve::as<wide_ft>()) << std::endl
<< "-> sqrt_3[lower](as(wxf)) = " << eve::sqrt_3[eve::lower](eve::as(wxf)) << std::endl
<< std::setprecision(17)
<< "-> sqrt_3(as<wide_dt>()) = " << eve::sqrt_3(eve::as<wide_dt>()) << std::endl
<< "-> sqrt_3(as(wxd)) = " << eve::sqrt_3(eve::as(wxd)) << std::endl
<< "-> sqrt_3[upper](as<wide_dt>()) = " << eve::sqrt_3[eve::upper](eve::as<wide_dt>()) << std::endl
<< "-> sqrt_3[upper](as(wxd)) = " << eve::sqrt_3[eve::upper](eve::as(wxd)) << std::endl
<< "-> sqrt_3[lower](as<wide_dt>()) = " << eve::sqrt_3[eve::lower](eve::as<wide_dt>()) << std::endl
<< "-> sqrt_3[lower](as(wxd)) = " << eve::sqrt_3[eve::lower](eve::as(wxd)) << std::endl;
float xf;
double xd;
std::cout << "---- scalar" << std::endl
<< "-> sqrt_3(as<float>()) = " << eve::sqrt_3(eve::as(float())) << std::endl
<< "-> sqrt_3(as<xf)) = " << eve::sqrt_3(eve::as(xf)) << std::endl
<< "-> sqrt_3(as<double>()) = " << eve::sqrt_3(eve::as(double()))<< std::endl
<< "-> sqrt_3(as<xd)) = " << eve::sqrt_3(eve::as(xd)) << std::endl;
std::cout << "-> constexpr sqrt_3 = " << constexpr_sqrt_3<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86