E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ diff_of_prod

auto eve::diff_of_prod = functor<diff_of_prod_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto diff_of_prod(floating_value auto x, floating_value auto y,
floating_value auto z, floating_value auto t) noexcept; // 1
// Lanes masking
constexpr auto diff_of_prod[conditional_expr auto c](floating_value auto x, floating_value auto y,
floating_value auto z, floating_value auto t) noexcept; // 2
// Semantic exclusive options
constexpr auto diff_of_prod[raw](floating_value auto x, floating_value auto y,
floating_value auto z, floating_value auto t) noexcept; // 3
constexpr auto diff_of_prod[pedantic](floating_value auto x, floating_value auto y,
floating_value auto z, floating_value auto t) noexcept; // 4
}
Specifies that a type is a Conditional Expression.
Definition conditional.hpp:28
The concept floating_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:116
constexpr auto diff_of_prod
elementwise_callable object computing the difference of products operation with better accuracy than ...
Definition diff_of_prod.hpp:83
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

  1. The value of x*y-z*t, with better precision if correct fma is available, is returned.
  2. The operation is performed conditionnaly.
  3. computes a raw version of diff_of_prod, i.e. the naive formula (in fact fms(x, y, z*t))
  4. computes a pedantic version of diff_of_prod ensuring better accuracy in any case.

Example

// revision 0
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wf0 = {3, 2, 1, 0};
eve::wide wf1 = {4, 1, 2, 100};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "<- wf1 = " << wf1 << "\n";
std::cout << "<- wf2 = " << wf2 << "\n";
std::cout << "<- wf3 = " << wf3 << "\n";
std::cout << "-> diff_of_prod(wf0, wf1, wf2, wf3) = " << eve::diff_of_prod(wf0, wf1, wf2, wf3) << "\n";
std::cout << "-> diff_of_prod[ignore_last(2)](wf0, wf1, wf2, wf3) = " << eve::diff_of_prod[eve::ignore_last(2)](wf0, wf1, wf2, wf3) << "\n";
std::cout << "-> diff_of_prod[raw](wf0, wf1, wf2, wf3) = " << eve::diff_of_prod[eve::raw](wf0, wf1, wf2, wf3) << "\n";
std::cout << "-> diff_of_prod[pedantic](wf0, wf1, wf2, wf3) = " << eve::diff_of_prod[eve::pedantic](wf0, wf1, wf2, wf3) << "\n";
}
constexpr auto eps
Computes a constant to the machine epsilon.
Definition eps.hpp:73
Lightweight type-wrapper.
Definition as.hpp:29
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition conditional.hpp:332
Wrapper for SIMD registers.
Definition wide.hpp:70