E.V.E
v2023.02.15

◆ pow1p

eve::pow1p = {}
inlineconstexpr

Callable object computing pow1p: \((1+x)^y\).

Defined in Header

#include <eve/module/math.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T, eve::floating_value U >
auto pow1p(T x, U y) noexcept; //1
template< eve::floating_value T, eve::floating_value U > //2
auto pow1p(eve::as_complex_t<T> x, U y) noexcept;
template< eve::floating_value T, eve::floating_value U > //2
auto pow1p(T x, eve::as_complex_t<U> y) noexcept;
template< eve::floating_value T, eve::floating_value U >
auto pow1p(eve::as_complex_t<T> x, eve::as_complex_t<U> y) noexcept; //2
}
constexpr callable_pow1p_ pow1p
Callable object computing pow1p: .
Definition: pow1p.hpp:80
Definition: abi.hpp:18

Parameters

x, y: real floating or complex arguments.

Return value

Returns the elementwise \((1+x)^y\), with good accuracy, even when x is small.

Example

#include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {2.0f, 3.0f, -4.0f, 2.0f, 2.0f,
wide_ft qf = {4.0f, 1.0f, -1.0f, 0.5f, 0.0f,
-2.0f, -3.0f, 2.5f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "<- qf = " << qf << '\n'
<< "-> pow1p(pf, qf) = " << eve::pow1p(pf, qf) << '\n'
;
float xf = 4.0f;
float yf = -1.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "<- yf = " << yf << '\n'
<< "-> pow1p(xf, yf) = " << eve::pow1p(xf, yf) << '\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::pow1p[mask](x, y) provides a masked version of eve::pow1p which is equivalent to if_else (mask, pow1p(x, y), x).

    Example

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