E.V.E  0.1-beta

◆ sqr_abs

eve::sqr_abs = {}
inlineconstexpr

Callable object computing the sqr_abs operation.

Required header: #include <eve/function/sqr_abs.hpp>

Members Functions

Member Effect
operator() the sqr_abs operation

auto operator()( floating_value auto x ) const noexcept;
Definition: value.hpp:83

Parameters

x: floating value.

Return value

Computes elementwise the square of the absolute value of x.


Supported decorators

  • eve::diff, eve::diff_1st, eve::diff_nth

    Required header: #include <eve/function/diff/sqr_abs.hpp>

    The expression diff(sqr_abs)(x) computes the derivative of the function at x.

Example

See it live on Compiler Explorer

#include <eve/function/sqr_abs.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-1.0f, 2.0f, -3.0f, 182.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> sqr_abs(pf) = " << eve::sqr_abs(pf) << '\n';
float xf = -32768.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> sqr_abs(xf) = " << eve::sqr_abs(xf) << '\n';
return 0;
}
constexpr callable_sqr_abs_ sqr_abs
Callable object computing the sqr_abs operation.
Definition: sqr_abs.hpp:63
Wrapper for SIMD registers.
Definition: wide.hpp:65