E.V.E
v2022.03.00

◆ 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;
}
constexpr callable_acospi_ acospi
Callable object computing the arc cosine in multiples.
Definition: acospi.hpp:60
Definition: all_of.hpp:22

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.

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