◆ exprecneg()

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

This function object computes: \(e^{-\frac1x}\).

Header <boost/simd/function/exprecneg.hpp>
Example:
#include <boost/simd/exponential.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::exprecneg(pf) = " << bs::exprecneg(pf) << '\n';
float xf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::exprecneg(xf) = " << bs::exprecneg(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::exprecneg(pf) = (0.367879, 0.606531, 2.71828, 0.135335)
---- scalar
<- xf = 2
-> bs::exprecneg(xf) = 0.606531