◆ sinc()

IEEEValue boost::simd::sinc ( IEEEValue const &  x)

This function object returns the Computes the sinus cardinal value of its parameter, i.e.

\(\sin(x)/x\).

Header <boost/simd/function/sinc.hpp>
See also
sin, sincpi, sinhc
Example:
#include <boost/simd/trigonometric.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft pf = {1.0f, 2.0f, -1.0f, 0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::sinc(pf) = " << bs::sinc(pf) << '\n';
float xf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::sinc(xf) = " << bs::sinc(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::sinc(pf) = (0.841471, 0.454649, 0.841471, 0.958851)
---- scalar
<- xf = 2
-> bs::sinc(xf) = 0.454649