◆ asech()

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

This function returns the hyperbolic secant argument \(\mathop{\textrm{acosh}}(1/x)\).

Header <boost/simd/function/asech.hpp>
See also
cosh, acosh, sinh, asinh, atanh, atanh, acoth, acsch
Example:
#include <boost/simd/hyperbolic.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, 0.0f, -1.0f, 0.5f};
std::cout
<< "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::asech(pf) = " << bs::asech(pf) << '\n';
float xf = 2.0f;
std::cout
<< "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::asech(xf) = " << bs::asech(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 0, -1, 0.5)
-> bs::asech(pf) = (0, inf, -nan, 1.31696)
---- scalar
<- xf = 2
-> bs::asech(xf) = -nan