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

◆ three_fma

eve::three_fma = functor<three_fma_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
// Regular overload
constexpr auto three_fma(floating_value auto a, floating_value auto b, floating_value auto c) noexcept; //1
// Semantic options
constexpr auto three_fma[pedantic](floating_value auto x, floating_value auto y) noexcept; //2
}
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:77
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107
EVE Main Namespace.
Definition abi.hpp:19

Parameters

Return value

  1. 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$
  2. take care of overflow

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

External references

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";
using f_t = eve::float16_t;
f_t aa(1000);
auto [a, b, c] = eve::three_fma(aa, aa, -aa);
std::cout << float(a) << " " << float(b) << " " << float(c) << std::endl;
}
constexpr auto eps
Computes a constant to the machine epsilon.
Definition eps.hpp:74
Wrapper for SIMD registers.
Definition wide.hpp:94