E.V.E
v2023.02.15

◆ expmx2

eve::expmx2 = {}
inlineconstexpr

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

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< value T>
T expmx2(T x) noexcept; //1
template< eve::floating_value T >
as_complex_t<T> expmx2(as_complex_t<T> z) noexcept; //2
}
constexpr callable_expmx2_ expmx2
Callable object computing .
Definition: expmx2.hpp:70
Definition: abi.hpp:18

Parameters

Parameters

x: floating real or complex value.

Return value

Returns the elementwise exponential of minus the square of 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, 2.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> expx2(pf, -1.0f) = " << eve::expmx2(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> expx2(xf) = " << eve::expmx2(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:60
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::expmx2[mask](x, ...) provides a masked version of eve::expmx2 which is equivalent to if_else (mask, expmx2(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'
    << "-> expmx2[pf > 1.0](pf) = " << eve::expmx2[pf > 1.0](pf) << '\n';
    return 0;
    }