E.V.E
v2022.09.01

◆ sqrt_pi

eve::sqrt_pi = {}
inlineconstexpr

Callable object computing the constant \(\sqrt{\pi}\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T sqrt_pi(as<T> x) noexcept;
}
constexpr callable_sqrt_pi_ sqrt_pi
Callable object computing the constant .
Definition: sqrt_pi.hpp:49
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::sqrt_pi(as<T>()) returns the square root of \(\pi\).

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>;
int main()
{
wide_ft wxf;
wide_dt wxd;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> sqrt_pi(as<wide_ft>()) = " << eve::sqrt_pi(eve::as<wide_ft>()) << std::endl
<< "-> sqrt_pi(as(wxf)) = " << eve::sqrt_pi(eve::as(wxf)) << std::endl
<< "-> upward(sqrt_pi)(as<wide_ft>()) = " << eve::upward(eve::sqrt_pi)(eve::as<wide_ft>()) << std::endl
<< "-> upward(sqrt_pi)(as(wxf)) = " << eve::upward(eve::sqrt_pi)(eve::as(wxf)) << std::endl
<< "-> downward(sqrt_pi)(as<wide_ft>()) = " << eve::downward(eve::sqrt_pi)(eve::as<wide_ft>()) << std::endl
<< "-> downward(sqrt_pi)(as(wxf)) = " << eve::downward(eve::sqrt_pi)(eve::as(wxf)) << std::endl
<< std::setprecision(17)
<< "-> sqrt_pi(as<wide_dt>()) = " << eve::sqrt_pi(eve::as<wide_dt>()) << std::endl
<< "-> sqrt_pi(as(wxd)) = " << eve::sqrt_pi(eve::as(wxd)) << std::endl
<< "-> upward(sqrt_pi)(as<wide_dt>()) = " << eve::upward(eve::sqrt_pi)(eve::as<wide_dt>()) << std::endl
<< "-> upward(sqrt_pi)(as(wxd)) = " << eve::upward(eve::sqrt_pi)(eve::as(wxd)) << std::endl
<< "-> downward(sqrt_pi)(as<wide_dt>()) = " << eve::downward(eve::sqrt_pi)(eve::as<wide_dt>()) << std::endl
<< "-> downward(sqrt_pi)(as(wxd)) = " << eve::downward(eve::sqrt_pi)(eve::as(wxd)) << std::endl;
float xf;
double xd;
std::cout << "---- scalar" << std::endl
<< "-> sqrt_pi(as<float>()) = " << eve::sqrt_pi(eve::as(float())) << std::endl
<< "-> sqrt_pi(as<xf)) = " << eve::sqrt_pi(eve::as(xf)) << std::endl
<< "-> sqrt_pi(as<double>()) = " << eve::sqrt_pi(eve::as(double()))<< std::endl
<< "-> sqrt_pi(as<xd)) = " << eve::sqrt_pi(eve::as(xd)) << std::endl;
return 0;
}
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