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

◆ fast_two_add

auto eve::fast_two_add = functor<fast_two_add_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::floating_value T, eve::floating_value U >
kumi::tuple<T, T> quick_two_add(T x, U y) noexcept;
}
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 \(\oplus\)y

where \(\oplus\) adds its two parameters with infinite precision.

Warning
the algoritm needs |x| >= |y|, and will assert if the condition is not met

Example

// revision 1
#include <eve/module/core.hpp>
#include <iostream>
int main()
{
eve::wide wf0 = {30.0, 2.5, -32.7, 1.0};
eve::wide wf1 = {4.2, 1.5, -10.834, eve::eps(eve::as<double>())/2};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "<- wf1 = " << wf1 << "\n";
std::cout << "-> fast_two_add(wf0, wf1) = " << eve::fast_two_add(wf0, wf1) << "\n";
}
constexpr auto fast_two_add
Computes the elementwise pair of add and error,.
Definition fast_two_add.hpp:71
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:86