E.V.E  0.1-beta

◆ expm1

eve::expm1 = {}
inlineconstexpr

Callable object computing \(e^x-1\).

Required header: #include <eve/function/expm1.hpp>

Members Functions

Member Effect
operator() the computation of expm1
operator[] Construct a conditional version of current function object

auto operator()( floating_real_value auto x ) const noexcept;
Definition: value.hpp:103

Parameters

x: floating real value.

Return value

Returns the elementwise exponential input minus one, with good accuracy, even for small values of x.

  • If the element is \(\pm0\), \(\pm0\) is returned
  • If the element is \(-\infty\), \(-1\) is returned
  • If the element is \(\infty\), \(\infty\) is returned
  • If the element is a NaN, NaN is returned

auto operator[]( conditional_expression auto cond ) const noexcept;

Higher-order function generating a masked version of eve::expm1

Parameters

cond : conditional expression

Return value

A Callable object so that the expression expm1[cond](x, ...) is equivalent to if_else(cond,expm1(x, ...),x)


Supported decorators

Example

See it live on Compiler Explorer

#include <eve/function/expm1.hpp>
#include <eve/wide.hpp>
#include <eve/constant/eps.hpp>
#include <eve/constant/inf.hpp>
#include <eve/constant/minf.hpp>
#include <eve/constant/nan.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, -0.0f, -1.0f, 1.0f, eve::eps(eve::as<float>()),
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> expm1(pf) = " << eve::expm1(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> expm1(xf) = " << eve::expm1(xf) << '\n';
return 0;
}
constexpr callable_eps_ eps
Callable object computing the machine epsilon.
Definition: eps.hpp:60
constexpr callable_nan_ nan
Callable object computing the nan value.
Definition: nan.hpp:52
constexpr callable_minf_ minf
Callable object computing the negative infinity value.
Definition: minf.hpp:55
constexpr callable_inf_ inf
Callable object computing the infinity ieee value.
Definition: inf.hpp:54
constexpr callable_expm1_ expm1
Callable object computing .
Definition: expm1.hpp:81
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65