E.V.E
v2022.03.00

◆ expx2

eve::expx2 = {}
inlineconstexpr

Callable object computing \(e^{\pm x^2}\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T, eve::floating_value U >
T expx2(T x, U s) noexcept;
}
constexpr callable_expx2_ expx2
Callable object computing .
Definition: expx2.hpp:63
Definition: all_of.hpp:22

Parameters

x: floating value.

Return value

Returns the elementwise exponential of the square of x multiplied by the sign of s trying to avoid overflow as possible.

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, -0.0f, -1.0f, 1.0f, 2.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> expx2(pf) = " << eve::expx2(pf) << '\n'
<< "-> expx2(pf, -1.0f) = " << eve::expx2(pf, -1.0f) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> expx2(xf) = " << eve::expx2(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
constexpr callable_minf_ minf
Computes the -infinity ieee value.
Definition: minf.hpp:95
constexpr callable_inf_ inf
Computes the infinity ieee value.
Definition: inf.hpp:58
Lightweight type-wrapper.
Definition: as.hpp:29
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers

  • Masked Call

    The call eve::expx2[mask](x, ...) provides a masked version of eve::expx2 which is equivalent to if_else (mask, expx2(x, ...), x).

    Example

    #include <eve/module/math.hpp>
    #include <eve/wide.hpp>
    #include <iostream>
    int main()
    {
    wide_ft pf = {0.0f, -0.0f, -1.0f, 1.0f, 20.0f,
    std::cout << "---- simd" << '\n'
    << "<- pf = " << pf << '\n'
    << "-> expx2[pf > 1.0](pf) = " << eve::expx2[pf > 1.0](pf) << '\n'
    << "-> expx2[pf > 1.0](pf, -1.0) = " << eve::expx2[pf > 1.0](pf, -1.0) << '\n';
    return 0;
    }