E.V.E
v2023.02.15
Loading...
Searching...
No Matches

◆ sinc

auto eve::sinc = functor<sinc_t>
inlineconstexpr

Header file

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto sinc(floating_value auto x) noexcept; // 1
// Lanes masking
constexpr auto sinc[conditional_expr auto c](floating_value auto x) noexcept; // 2
constexpr auto sinc[logical_value auto m](floating_value auto x) noexcept; // 2
// Semantic options
constexpr auto sinc[radpi](floating_value auto x) noexcept; // 1.c
constexpr auto sinc[quarter_circle](floating_value auto x) noexcept; // 3.a
constexpr auto sinc[half_circle](floating_value auto x) noexcept; // 3.b
constexpr auto sinc[full_circle](floating_value auto x) noexcept; // 3.c
constexpr auto sinc[raw](floating_value auto x) noexcept; // 4.a
constexpr auto sinc[fast] (floating_value auto x) noexcept; // 4.b
constexpr auto sinc[radpi](floating_value auto x) noexcept; // 5
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition value.hpp:134
constexpr auto raw
Performs the operation minimally, trading accuracy for speed.
Definition core.hpp:95
constexpr auto fast
Performs the operation faster than the regular call while keeping more accuracy than raw.
Definition core.hpp:79
constexpr auto sinc
elementwise_callable object computing the sine cardinal.
Definition sinc.hpp:95
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. Returns the elementwise sine of the input divided by the input. 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.
  2. The operation is performed conditionally.
  3. These are optimized calls providing a balance between speed and range limitation.
    1. assumes that the inputs elements belong to \([-\pi/4,\pi/4]\) and return NaN outside.
    2. assumes that the inputs elements belong to \([-\pi/2,\pi/2]\) and return NaN outside.
    3. assumes that the inputs elements belong to \([-\pi,\pi]\) and return NaN outside. these options can be combined with the previous ones with ranges adapted to the chosen unity.
  4. returns \(\frac{\sin \pi x}{\pi x}\)

    External references

Example

// revision 1
#include <eve/module/math.hpp>
#include <iostream>
int main()
{
eve::wide wf = {0.0, 1.0, 2.0, 20.0, 100.0, 1000.0,
std::cout << "<- wf = " << wf << "\n";
std::cout << "-> sinc(wf) = " << eve::sinc(wf) << "\n";
std::cout << "-> sinc[ignore_last(2)](wf)= " << eve::sinc[eve::ignore_last(2)](wf) << "\n";
std::cout << "-> sinc[wf != 2.0f](wf) = " << eve::sinc[wf != 2.0f](wf) << "\n";
}
constexpr auto nan
Computes the IEEE quiet NaN constant.
Definition nan.hpp:67
constexpr auto inf
Computes the infinity ieee value.
Definition inf.hpp:67
Lightweight type-wrapper.
Definition as.hpp:29
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:361
Wrapper for SIMD registers.
Definition wide.hpp:94