E.V.E
v2022.03.00

◆ atanpi

eve::atanpi = {}
inlineconstexpr

Callable object computing arc tangent in \(\pi\) multiples.

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T >
T atanpi(T x) noexcept;
}
constexpr callable_atanpi_ atanpi
Callable object computing arc tangent in multiples.
Definition: atanpi.hpp:60
Definition: all_of.hpp:22

Parameters

x: floating real value.

Return value

Returns the elementwise arc cotangent of the input in the range \([-\frac12, \frac12]\).

In particular:

  • If the element is \(\pm0\), \(\pm0\) is returned.
  • If the element is \(\pm\infty\), \(\pm\frac\pi2\) 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'
<< "-> atanpi(pf) = " << eve::atanpi(pf) << '\n';
float xf = 1.0f;
float yf = -2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> atanpi(xf) = " << eve::atanpi(xf) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> atanpi(yf) = " << eve::atanpi(yf) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65