◆ sinhcosh()

std::pair<IEEEValue, IEEEValue> boost::simd::sinhcosh ( IEEEValue const &  x)

This function object computes simultaneously and at lower cost the sinh and cosh of the input.

Header <boost/simd/function/sinhcosh.hpp>
See also
sinh, cosh
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, -2.0f, 3.0f, -4.0 };
pack_ft s, e;
std::tie(s, e) = bs::sinhcosh(pf);
std::cout
<< "---- simd" << '\n'
<< " <- pf = " << pf << '\n'
<< " std::tie(s, e) = bs::sinhcosh(pf, qf) " << '\n'
<< " -> s = " << s << '\n'
<< " -> e = " << e << '\n';
float xf = 3.0f;
float ss, se;
std::tie(ss, se) = bs::sinhcosh(xf);
std::cout
<< "---- scalar" << '\n'
<< " xf = " << xf << '\n'
<< " std::tie(ss, se) = bs::sinhcosh(xf, yf) " << '\n'
<< " -> ss = " << ss << '\n'
<< " -> se = " << se << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, -2, 3, -4)
std::tie(s, e) = bs::sinhcosh(pf, qf)
-> s = (1.1752, -3.62686, 10.0179, -27.2899)
-> e = (1.54308, 3.7622, 10.0677, 27.3082)
---- scalar
xf = 3
std::tie(ss, se) = bs::sinhcosh(xf, yf)
-> ss = 10.0179
-> se = 10.0677