◆ atanpi()

IEEEValue boost::simd::atanpi ( IEEEValue const &  x)

This function object returns the inverse tangent in \(\pi\) multiples.

Header <boost/simd/function/atanpi.hpp>
Note

For every parameter of floating type atanpi(x) returns the arc r in the interval \([-0.5, 0.5[\) such that tanpi(r) == x.

See also
atan2, atan2d, atand, atan, tanpi
Example:
#include <boost/simd/trigonometric.hpp>
#include <boost/simd/pack.hpp>
#include <iostream>
namespace bs = boost::simd;
using pack_ft = bs::pack <float, 4>;
int main()
{
pack_ft pf = {1.0f, 2.0f, -1.0f, 0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::atanpi(pf) = " << bs::atanpi(pf) << '\n';
float xf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::atanpi(xf) = " << bs::atanpi(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::atanpi(pf) = (0.25, 0.352416, -0.25, 0.147584)
---- scalar
<- xf = 2
-> bs::atanpi(xf) = 0.352416