E.V.E
v2022.03.00

◆ sinpicospi

eve::sinpicospi = {}
inlineconstexpr

Callable object computing the simultaneous computation of sin an cos from an argument in \(\pi\) multiples.

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
kumi::tuple<T, T> sinpicospi(T x) noexcept;
}
constexpr callable_sinpicospi_ sinpicospi
Callable object computing the simultaneous computation of sin an cos from an argument in multiples.
Definition: sinpicospi.hpp:66
Definition: all_of.hpp:22

Parameters

x: floating real value.

Return value

The computation returns a pair and is semantically equivalent to {sinpi(x), cospi(x)}

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main(){
wide_ft pf = {1.0f, 0.0f, eve::inf(eve::as<float>()), 0.5f};
auto [s, c] = eve::sinpicospi(pf);
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> sinpicospi(pf) = [" << '\n'
<< " " << s << ", \n"
<< " " << c << '\n'
<< " ]\n";
float xf = 2.3;
auto [ss, sc] = eve::sinpicospi(xf);
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> sinpicospi(xf) = [" << ss << ", " << sc << "]\n";
return 0;
}
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers