◆ atan()

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

This function object returns the inverse tangent.

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

For every parameter of floating type atan(x) returns the arc r in the interval \([-\pi/2, \pi/2[\) such that tan(r) == x.

Decorators
  • std_ for floating entries provides access to std::atan
See also
atan2, atand, atanpi, tan
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::atan(pf) = " << bs::atan(pf) << '\n';
float xf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::atan(xf) = " << bs::atan(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::atan(pf) = (0.785398, 1.10715, -0.785398, 0.463648)
---- scalar
<- xf = 2
-> bs::atan(xf) = 1.10715