Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
correctly_rounded.hpp File Reference
#include <cmath>
#include <cstdint>
#include <limits>
#include <optional>
#include <universal/number/qd/qd.hpp>
#include <universal/number/bposit/math/shim.hpp>

Classes

struct  sw::universal::bposit_math::wide_accumulator

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal
namespace  sw::universal::bposit_math

Macros

#define BPOSIT_MATH_FAST_PATH   1
#define BPOSIT_MATH_LIBM_ULPS   4

Enumerations

enum class  sw::universal::bposit_math::engine { sw::universal::bposit_math::libm_then_qd , sw::universal::bposit_math::qd_only }

Functions

qd sw::universal::bposit_math::dyadic_to_qd (bool negative, std::uint64_t m, int e)
template<typename B>
qd sw::universal::bposit_math::to_qd (const B &x)
template<typename B>
qd sw::universal::bposit_math::one_plus (const B &x, int s)
template<typename B>
B sw::universal::bposit_math::round_to (const qd &v)
template<typename B>
std::optional< B > sw::universal::bposit_math::decide (const qd &y, const qd &err)
template<typename B>
B sw::universal::bposit_math::snap (const qd &y)
template<typename B>
B sw::universal::bposit_math::from_qd (const qd &y, double magnitude_floor=0.0)
template<typename B>
std::optional< B > sw::universal::bposit_math::from_libm (double y, double ulps=BPOSIT_MATH_LIBM_ULPS, double magnitude_floor=0.0)
template<engine E, typename B, typename Libm, typename Kernel>
B sw::universal::bposit_math::evaluate (const B &x, Libm libm, Kernel kernel)
template<engine E, typename B, typename Libm, typename Kernel>
B sw::universal::bposit_math::evaluate (const B &x, const B &y, Libm libm, Kernel kernel)
template<typename B>
constexpr bool sw::universal::bposit_math::above_range (double log2_magnitude)
template<typename B>
constexpr bool sw::universal::bposit_math::below_range (double log2_magnitude)

Variables

template<typename B>
constexpr bool sw::universal::bposit_math::exact_in_double = (B::fbits + 1 <= 53) && (B::maxscale < 1000) && (B::minscale > -1000)
template<typename B>
constexpr bool sw::universal::bposit_math::qd_engine = (B::maxscale <= 600) && (B::minscale >= -600)
constexpr int sw::universal::bposit_math::qd_error_exponent = -170
constexpr int sw::universal::bposit_math::snap_exponent = -160

Macro Definition Documentation

◆ BPOSIT_MATH_FAST_PATH

#define BPOSIT_MATH_FAST_PATH   1

◆ BPOSIT_MATH_LIBM_ULPS

#define BPOSIT_MATH_LIBM_ULPS   4