MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
pow2_scaling.hpp File Reference
#include <cmath>
#include <concepts>
#include <cstddef>
#include <initializer_list>
#include <limits>
#include <type_traits>
#include <vector>
#include <mtl/concepts/magnitude.hpp>

Classes

struct  mtl::math::pow2_scaling< T >
 exponent(m): the e with 2^e <= m < 2^(e+1), for a positive finite m. More...
struct  mtl::math::pow2_scaling< T >
struct  mtl::math::detail::plain_givens_bounds< T >
 The magnitudes m = max(|a|, |b|) for which the plain formula is safe, as the open interval (lo, hi): hi = sqrt(max) / 4, so a*a + b*b <= 2 m^2 stays below max; lo = 4 sqrt(min / eps), so m^2 > 16 min / eps, and any b*b too small to be normal is below half an ulp of a*a and drops out of the sum exactly as it does in the scaled form. More...
struct  mtl::math::givens_parameters< T >
 A plane rotation G = [c s; -conj(s) c] with c a + s b = r and -conj(s) a + c b = 0. More...

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.
namespace  mtl::math
namespace  mtl::math::detail

Concepts

concept  mtl::detail::converts_to_double
 T has an explicit or implicit conversion to double.
concept  mtl::math::detail::binary_ieee_limits
 T is a binary IEEE-754 format, as its numeric_limits declare (#697).

Functions

template<typename T>
givens_parameters< T > mtl::math::givens_rotation (const T &a, const T &b)
 The rotation that maps (a, b) to (r, 0), with |r| = sqrt(|a|^2 + |b|^2) formed without avoidable overflow or underflow (see the top of this file).
template<typename T>
T mtl::math::scaled_hypot (const T &a, const T &b)
 sqrt(a^2 + b^2), scaled as givens_rotation() scales it.

Variables

template<typename T>
const plain_givens_bounds< T > mtl::math::detail::plain_givens_interval