E.V.E  0.1-beta

◆ sinpic

eve::sinpic = {}
inlineconstexpr

Callable object computing sinpic.

Required header: #include <eve/function/sinpic.hpp>

Members Functions

Member Effect
operator() the computation of sinpic

auto operator()(floating_value auto x) const noexcept;
Definition: value.hpp:83

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.

Supported decorators

  • eve::diff, eve::diff_1st, eve::diff_nth

    Required header: #include <eve/function/diff/sinpic.hpp>

    The expression diff(sinpic)(x) computes the derivative of the function at x.

Example

See it live on Compiler Explorer

#include <eve/function/sinpic.hpp>
#include <eve/wide.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/pi.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
Callable object computing the infinity ieee value.
Definition: inf.hpp:54
constexpr callable_sinpic_ sinpic
Callable object computing sinpic.
Definition: sinpic.hpp:69
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65