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

◆ two_prod

auto eve::two_prod = functor<two_prod_t>
inlineconstexpr

Header file

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
constexpr auto two_prod(floating_value auto x, floating_value auto y) noexcept;
}
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 two_prod
Computes the elementwise pair of product and error,.
Definition two_prod.hpp:70
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

Computes elementwise a pair of values [a,e] such that:

  • a is x*y
  • e is a value such that a \(\oplus\)e is equal to x \(\otimes\)y, where \(\oplus\) (resp. \(\otimes\)) adds (resp. multiplies) its two parameters with infinite precision.

Example

// revision 1
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wf0 = {3.0, 2.5, -32.7, 1.0};
eve::wide wf1 = {4.2, 1.5, -100.834, eve::eps(eve::as<double>())/2};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "<- wf1 = " << wf1 << "\n";
std::cout << "-> two_prod(wf0, wf1) = " << eve::two_prod(wf0, wf1) << "\n";
}
constexpr auto eps
Computes a constant to the machine epsilon.
Definition eps.hpp:73
Lightweight type-wrapper.
Definition as.hpp:29
Wrapper for SIMD registers.
Definition wide.hpp:70