E.V.E
v2022.09.01

◆ rec

eve::rec = {}
inlineconstexpr

Computes the inverse of the parameter.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
T rec(T x) noexcept;
}
constexpr callable_rec_ rec
Computes the inverse of the parameter.
Definition: rec.hpp:73
Definition: all_of.hpp:22

Parameters

Return value

value containing the elementwise inverse value of x.

Note
For real integral value x is semantically equivalent to:

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, 2.0f, 10.0f, 200.0f, 1000.0f,
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> rec)(pf) = " << eve::rec(pf) << '\n';
float xf = 1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> rec(xf) = " << eve::rec(xf) << '\n';
return 0;
}
constexpr callable_nan_ nan
Computes the IEEE NaN constant.
Definition: nan.hpp:53
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;rec[mask](x) provides a masked version of eve::rec which is equivalent to if_else (mask, rec(x), x).

    Example

    #include <eve/module/core.hpp>
    #include <eve/wide.hpp>
    #include <iostream>
    int main()
    {
    wide_ft pf = {0.0f, 1.0f, 2.0f, 10.0f, 200.0f, 1000.0f,
    std::cout << "---- simd" << '\n'
    << "<- pf = " << pf << '\n'
    << "-> rec[pf > 1](pf) = " << eve::rec[pf > 1](pf) << '\n';
    return 0;
    }
  • eve::raw

    The call raw(rec)(x), call a proper system intrinsic if one exists, but with possibly very poor accuracy in return. Otherwise it uses the non decorated call.