E.V.E
v2022.09.01

◆ rempio2

eve::rempio2 = {}
inlineconstexpr

Callable object computing the remainder of the division by \(\pi/2\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
kumi::tuple<eve::as_integer<T>, T, T> rempio2(T x) noexcept;
}
constexpr callable_rempio2_ rempio2
Callable object computing the remainder of the division by .
Definition: rempio2.hpp:74
Definition: all_of.hpp:22

Parameters

x: floating 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.

Example

#include <eve/module/math.hpp>
#include <eve/wide.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 constant .
Definition: pi.hpp:49
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65