◆ exp()

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

This function object returns the exponential of its argument: \(e^{x}\).

Header <boost/simd/function/exp.hpp>
Decorators
  • std_ for floating entries calls std::exp
See also
exp2, exp10, pow, expm1, log
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::exp(pf) = " << bs::exp(pf) << '\n';
float xf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::exp(xf) = " << bs::exp(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, -1, 0.5)
-> bs::exp(pf) = (2.71828, 7.38906, 0.367879, 1.64872)
---- scalar
<- xf = 2
-> bs::exp(xf) = 7.38906