MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::math::detail::binary_ieee_limits Concept Reference

T is a binary IEEE-754 format, as its numeric_limits declare (#697). More...

#include <pow2_scaling.hpp>

Concept definition

template<typename T>
concept mtl::math::detail::binary_ieee_limits = std::numeric_limits<T>::is_specialized &&
std::numeric_limits<T>::is_iec559 &&
std::numeric_limits<T>::radix == 2
T is a binary IEEE-754 format, as its numeric_limits declare (#697).
Definition pow2_scaling.hpp:207

Detailed Description

T is a binary IEEE-754 format, as its numeric_limits declare (#697).

For such a T, scaling by 2^-e is exact, so wherever a*a + b*b neither overflows nor loses a term to underflow, the scaled rotation and the plain formula give the same r, and givens_rotation can skip the scaling. They give the same c and s too, except where c or s is itself subnormal: there the scaled form rounds a 2^-e or b 2^-e before it divides, and the plain form rounds the quotient once, so the plain result is the correctly rounded one. This is a property of the format, not of the built-in types: a user-defined type that declares is_iec559 gets the same fast path. A tapered type (posit, takum) does not declare it, and keeps the scaled path, which keeps its arithmetic near 1, where it is most precise.