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

◆ sqrt_pio_2

auto eve::sqrt_pio_2 = functor<sqrt_pio_2_t>
inlineconstexpr

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T sqrt_pio_2(as<T> x) noexcept;
}
constexpr auto sqrt_pio_2
Callable object computing the constant .
Definition sqrt_pio_2.hpp:77
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_pio_2(as<T>()) returns the square root of \(\pi/2\).

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_pio_2() { return eve::sqrt_pio_2(eve::as<T>{}); }
int main()
{
wide_ft wxf;
wide_dt wxd;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> sqrt_pio_2(as<wide_ft>()) = " << eve::sqrt_pio_2(eve::as<wide_ft>()) << std::endl
<< "-> sqrt_pio_2(as(wxf)) = " << eve::sqrt_pio_2(eve::as(wxf)) << std::endl
<< "-> sqrt_pio_2[upper](as<wide_ft>()) = " << eve::sqrt_pio_2[eve::upper](eve::as<wide_ft>()) << std::endl
<< "-> sqrt_pio_2[upper](as(wxf)) = " << eve::sqrt_pio_2[eve::upper](eve::as(wxf)) << std::endl
<< "-> sqrt_pio_2[lower](as<wide_ft>()) = " << eve::sqrt_pio_2[eve::lower](eve::as<wide_ft>()) << std::endl
<< "-> sqrt_pio_2[lower](as(wxf)) = " << eve::sqrt_pio_2[eve::lower](eve::as(wxf)) << std::endl
<< std::setprecision(17)
<< "-> sqrt_pio_2(as<wide_dt>()) = " << eve::sqrt_pio_2(eve::as<wide_dt>()) << std::endl
<< "-> sqrt_pio_2(as(wxd)) = " << eve::sqrt_pio_2(eve::as(wxd)) << std::endl
<< "-> sqrt_pio_2[upper](as<wide_dt>()) = " << eve::sqrt_pio_2[eve::upper](eve::as<wide_dt>()) << std::endl
<< "-> sqrt_pio_2[upper](as(wxd)) = " << eve::sqrt_pio_2[eve::upper](eve::as(wxd)) << std::endl
<< "-> sqrt_pio_2[lower](as<wide_dt>()) = " << eve::sqrt_pio_2[eve::lower](eve::as<wide_dt>()) << std::endl
<< "-> sqrt_pio_2[lower](as(wxd)) = " << eve::sqrt_pio_2[eve::lower](eve::as(wxd)) << std::endl;
float xf;
double xd;
std::cout << "---- scalar" << std::endl
<< "-> sqrt_pio_2(as<float>()) = " << eve::sqrt_pio_2(eve::as(float())) << std::endl
<< "-> sqrt_pio_2(as<xf)) = " << eve::sqrt_pio_2(eve::as(xf)) << std::endl
<< "-> sqrt_pio_2(as<double>()) = " << eve::sqrt_pio_2(eve::as(double()))<< std::endl
<< "-> sqrt_pio_2(as<xd)) = " << eve::sqrt_pio_2(eve::as(xd)) << std::endl;
std::cout << "-> constexpr sqrt_pio_2 = " << constexpr_sqrt_pio_2<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:86