Template Function librapid::detail::multiprec::addX2#

Function Documentation#

template<typename T>
constexpr auto librapid::detail::multiprec::addX2(const T &x, const T &y) noexcept -> Fmp<T>#

Summarizes two 1x precision values combined into a 2x precision result.

This function is exact when:

  1. The result doesn’t overflow

  2. Either underflow is gradual, or no internal underflow occurs

  3. Intermediate precision is either the same as T, or greater than twice the precision of T

  4. Parameters and local variables do not retain extra intermediate precision

  5. Rounding mode is rounding to nearest.

Violation of condition 3 or 5 could lead to relative error on the order of epsilon^2.

Violation of other conditions could lead to worse results

Template Parameters

T – Template type

Parameters
  • x – First value

  • y – Second value

Returns

Sum of x and y