◆ atanh()

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

This function object returns the hyperbolic tangent argument \(\frac12\log\frac{1+x}{1-x}\).

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