E.V.E  0.1-beta

◆ acospi

eve::acospi = {}
inlineconstexpr

Callable object computing acospi.

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

Members Functions

Member Effect
operator() the computation of acospi

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

Parameters

x: floating real value.

Return value

Returns the elementwise value in \(pi\) multiples of the arc cosine of the input in the range \([0, 1]\).

In particular:

  • If the element is \(1\), \(+0\) is returned.
  • If the element \(|x| > 1\), NaN 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/acospi.hpp>

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

Example

See it live on Compiler Explorer

#include <eve/function/acospi.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = { 0.0f, 1.0f, -1.0f, -0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> acospi(pf) = " << eve::acospi(pf) << '\n';
float xf = 1.0f;
float yf = eve::nan(eve::as<float>());
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> acospi(xf) = " << eve::acospi(xf) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> acospi(yf) = " << eve::acospi(yf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Callable object computing the nan value.
Definition: nan.hpp:52
constexpr callable_acospi_ acospi
Callable object computing acospi.
Definition: acospi.hpp:70
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65