◆ asin()

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

This function object returns the inverse sine.

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

For every parameter of floating type asin(x) returns the arc r in the interval \([-\pi/2, \pi/2]\) such that sin(r) == x. If x is outside \([-1, 1]\) the result is Nan.

Decorators
  • std_ for floating entries provides access to std::asin
See also
asind, asinpi, sin
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::asin(pf) = " << bs::asin(pf) << '\n';
float xf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::asin(xf) = " << bs::asin(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::asin(pf) = (1.5708, -nan, -1.5708, 0.523599)
---- scalar
<- xf = 2
-> bs::asin(xf) = -nan