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

◆ three_fma

auto eve::three_fma = functor<three_fma_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
constexpr auto three_fma(floating_value auto a, floating_value auto b, floating_value auto c) 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 three_fma
Computes the elementwise triplet of an fma value f and two errors e1 and e2 such that .
Definition three_fma.hpp:70
EVE Main Namespace.
Definition abi.hpp:18

Parameters

Return value

Computes elementwise a triplet of values [f, r1, r2] such that:

  • f is fma(a, x, y)
  • \f$ a\otimes x\oplus y = r1\oplus r2\oplus r3\f$ exactly ! * \( |r1 \oplus r2| \le ulp(r1)/2\)
  • \f$ |r2| \le ulp(r2)/2\f$

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 = {30.0, 2.5, -32.7, 1.0};
eve::wide wf1 = {4.2, 1.5, -100.834, eve::eps(eve::as<double>())/2};
eve::wide wf2 = {2.0, 1.234, -2.0, eve::eps(eve::as<double>())/2};
std::cout << "<- wf0 = " << wf0 << "\n";
std::cout << "<- wf1 = " << wf1 << "\n";
std::cout << "<- wf2 = " << wf2 << "\n";
std::cout << "-> three_fma(wf0, wf1, wf2) = " << eve::three_fma(wf0, wf1, wf2) << "\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