E.V.E
v2022.03.00

◆ sinpic

eve::sinpic = {}
inlineconstexpr

Callable object computing the normalized cardinal sine.

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T sinpic(T x) noexcept;
}
constexpr callable_sinpic_ sinpic
Callable object computing the normalized cardinal sine.
Definition: sinpic.hpp:61
Definition: all_of.hpp:22

Parameters

x: floating real value.

Return value

Returns the elementwise sine of the input times \(\pi\) divided by the input times \(\pi\).

In particular:

  • If the element is \(\pm0\), \(1\) is returned.
  • If the element is \(\pm\infty\), 0 is returned.
  • If the element is a Nan, NaN is returned.

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};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> sinpic(pf) = " << eve::sinpic(pf) << '\n'
;
float xf = 3.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> sinpic(xf) = " << eve::sinpic(xf) << '\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