E.V.E
v2023.02.15

◆ acospi

eve::acospi = {}
inlineconstexpr

Callable object computing the arc cosine in \(\pi\) multiples.

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T acospi(T x) noexcept; //1
template< eve::floating_value T >
}
constexpr callable_acospi_ acospi
Callable object computing the arc cosine in multiples.
Definition: acospi.hpp:68
Definition: abi.hpp:18
SIMD-compatible representation of complex numbers.
Definition: complex.hpp:39

Parameters

Return value

  1. Returns the elementwise arc cosine of the input in \(\pi\) multiples, 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.
  2. Returns elementwise the complex principal value of the arc cosine of the input in \(\pi\) multiples. Branch cuts exist outside the interval \([-1, +1]\) along the real axis.

Example

#include <eve/module/math.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
Computes the IEEE NaN constant.
Definition: nan.hpp:53
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65