E.V.E  0.1-beta

◆ rempio2

eve::rempio2 = {}
inlineconstexpr

Callable object computing the rempio2 value.

Required header: #include <eve/function/rempio2.hpp>

Members Functions

Member Effect
operator() the computation of the rempio2 value

template< floating_value T> auto operator()( T x ) const noexcept;

Parameters

x: floating real value.

Return value

A tuple consisting of an flint value designing the quadrant and two floating values of type T giving the remainder of x modulo \(\pi/2\) and a corrective to the rounding error on the first result.


Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/rempio2.hpp>
#include <eve/wide.hpp>
#include <eve/constant/pi.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0f, 0.0f, 367.0f, -1005600.0f, eve::pi(eve::as<float>())/8,
auto [n, x, dx] = eve::rempio2(pf);
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> rempio2(pf) = [" << '\n'
<< " " << n << ", \n"
<< " " << x << '\n'
<< " " << dx << '\n'
<< " ]\n";
float xf = 2.3;
auto [sn, sx, sdx] = eve::rempio2(xf);
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> rempio2(xf) = [" << sn << ", " << sx << ", " << sdx << "]\n";
return 0;
}
constexpr callable_pi_ pi
Callable object computing the value.
Definition: pi.hpp:54
constexpr callable_rempio2_ rempio2
Callable object computing the rempio2 value.
Definition: rempio2.hpp:75
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65