◆ expm1()

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

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

Header <boost/simd/function/expm1.hpp>
Notes
  • result is accurate even for x of small modulus
Decorators
  • std_ for floating entries calls std::expm1
See also
exp
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.0e-20f, 0.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> bs::expm1(pf) = " << bs::expm1(pf) << '\n';
float xf = 2.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> bs::expm1(xf) = " << bs::expm1(xf) << '\n';
return 0;
}
Possible output:
---- simd
<- pf = (1, 2, 1e-20, 0.5)
-> bs::expm1(pf) = (1.71828, 6.38906, 1e-20, 0.648721)
---- scalar
<- xf = 2
-> bs::expm1(xf) = 6.38906