E.V.E
v2023.02.15

◆ expx2

eve::expx2 = {}
inlineconstexpr

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

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< floating_value T>
T expx2(T x) noexcept; //1
template< eve::floating_value T >
as_complex_t<T> expx2(as_complex_t<T> z) noexcept; //2
! }
constexpr callable_expx2_ expx2
Callable object computing .
Definition: expx2.hpp:67
Definition: abi.hpp:18

Parameters

Return value

Returns the elementwise exponential of the square of x trying to avoid overflow as possible in the real case.

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';
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: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::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';
    return 0;
    }