Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::takum_wide_range Namespace Reference

Classes

struct  dd

Enumerations

enum class  integral_mode { trunc , round , floor , ceil }

Functions

dd two_sum (double a, double b)
dd add (const dd &a, const dd &b)
dd mul (const dd &a, const dd &b)
dd neg (const dd &a)
template<typename T>
int64_t characteristic (const T &x)
template<typename T>
bool is_tiny (const T &x)
template<typename T>
bool is_huge (const T &x)
template<typename T>
bool is_far (const T &x)
template<typename T>
T saturated (bool high, bool negative)
template<typename T>
dd ln_abs (const T &x)
template<typename T>
T assemble (const typename T::Codec::encoded &enc, bool negative)
template<typename T>
T from_ln (const dd &L, bool negative)
template<typename T>
T from_log2 (const dd &t, bool negative)
template<typename T>
T scaled (double r, int64_t k)
template<typename T>
int64_t binary_exponent (const T &x)
template<typename T>
double scaled_down (const T &x, int64_t k)
template<typename T>
T absolute (const T &x)
template<typename T>
std::optional< T > exp (const T &x)
template<typename T>
std::optional< T > exp2 (const T &x)
template<typename T>
std::optional< T > exp10 (const T &x)
template<typename T>
std::optional< T > expm1 (const T &x)
template<typename T>
std::optional< T > sinh (const T &x)
template<typename T>
std::optional< T > cosh (const T &x)
template<typename T>
std::optional< T > asinh (const T &x)
template<typename T>
std::optional< T > acosh (const T &x)
template<typename T>
std::optional< T > identity_if_tiny (const T &x)
template<typename T>
std::optional< T > one_if_tiny (const T &x)
template<typename T>
std::optional< T > reciprocal_if_tiny (const T &x)
template<typename T>
std::optional< T > log (const T &x)
template<typename T>
std::optional< T > log2 (const T &x)
template<typename T>
std::optional< T > log10 (const T &x)
template<typename T>
std::optional< T > log1p (const T &x)
template<typename T>
std::optional< T > pow_core (const T &x, double dy, bool yHuge, bool yTiny, bool yNegative)
template<typename T>
std::optional< T > pow (const T &x, const T &y)
template<typename T>
std::optional< T > pow (const T &x, double y)
template<typename T>
std::optional< T > erf (const T &x)
template<typename T>
std::optional< T > erfc (const T &x)
template<typename T>
std::optional< T > hypot (const T &x, const T &y)
template<typename T>
std::optional< T > atan2 (const T &y, const T &x)
template<typename T>
std::optional< T > integral (const T &x, integral_mode mode)
template<typename T>
std::optional< T > frac (const T &x)
uint64_t mulmod (uint64_t a, uint64_t b, uint64_t m)
uint64_t pow2mod (uint64_t e, uint64_t m)
int compare_scaled (uint64_t A, int64_t ea, uint64_t B, int64_t eb)
template<typename T>
std::optional< T > fmod_exact (const T &x, const T &y, bool ieee_remainder)

Variables

constexpr double ln2_hi = 0x1.62e42fefa39efp-1
constexpr double ln2_lo = 0x1.abc9e3b39803fp-56
constexpr double inv_ln2_hi = 0x1.71547652b82fep+0
constexpr double inv_ln2_lo = 0x1.777d0ffda0d24p-56
constexpr double log2_10_hi = 0x1.a934f0979a371p+1
constexpr double log2_10_lo = 0x1.7f2495fb7fa6dp-53
constexpr double inv_ln10_hi = 0x1.bcb7b1526e50ep-2
constexpr double inv_ln10_lo = 0x1.95355baaafad3p-57
constexpr double half_ln_pi_hi = 0x1.250d048e7a1bdp-1
constexpr double half_ln_pi_lo = 0x1.7abf2ad8d5088p-58
constexpr double ln_2_over_sqrt_pi_hi = 0x1.eeb95b094c191p-4
constexpr double ln_2_over_sqrt_pi_lo = 0x1.346863f58b075p-58

Enumeration Type Documentation

◆ integral_mode

Enumerator
trunc 
round 
floor 
ceil 

Function Documentation

◆ absolute()

template<typename T>
T sw::universal::takum_wide_range::absolute ( const T & x)

◆ acosh()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::acosh ( const T & x)

◆ add()

dd sw::universal::takum_wide_range::add ( const dd & a,
const dd & b )
inline

◆ asinh()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::asinh ( const T & x)

◆ assemble()

template<typename T>
T sw::universal::takum_wide_range::assemble ( const typename T::Codec::encoded & enc,
bool negative )

◆ atan2()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::atan2 ( const T & y,
const T & x )

◆ binary_exponent()

template<typename T>
int64_t sw::universal::takum_wide_range::binary_exponent ( const T & x)

◆ characteristic()

template<typename T>
int64_t sw::universal::takum_wide_range::characteristic ( const T & x)

◆ compare_scaled()

int sw::universal::takum_wide_range::compare_scaled ( uint64_t A,
int64_t ea,
uint64_t B,
int64_t eb )
inline

◆ cosh()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::cosh ( const T & x)

◆ erf()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::erf ( const T & x)

◆ erfc()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::erfc ( const T & x)

◆ exp()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::exp ( const T & x)

◆ exp10()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::exp10 ( const T & x)

◆ exp2()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::exp2 ( const T & x)

◆ expm1()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::expm1 ( const T & x)

◆ fmod_exact()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::fmod_exact ( const T & x,
const T & y,
bool ieee_remainder )

◆ frac()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::frac ( const T & x)

◆ from_ln()

template<typename T>
T sw::universal::takum_wide_range::from_ln ( const dd & L,
bool negative )

◆ from_log2()

template<typename T>
T sw::universal::takum_wide_range::from_log2 ( const dd & t,
bool negative )

◆ hypot()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::hypot ( const T & x,
const T & y )

◆ identity_if_tiny()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::identity_if_tiny ( const T & x)

◆ integral()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::integral ( const T & x,
integral_mode mode )

◆ is_far()

template<typename T>
bool sw::universal::takum_wide_range::is_far ( const T & x)

◆ is_huge()

template<typename T>
bool sw::universal::takum_wide_range::is_huge ( const T & x)

◆ is_tiny()

template<typename T>
bool sw::universal::takum_wide_range::is_tiny ( const T & x)

◆ ln_abs()

template<typename T>
dd sw::universal::takum_wide_range::ln_abs ( const T & x)

◆ log()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::log ( const T & x)

◆ log10()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::log10 ( const T & x)

◆ log1p()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::log1p ( const T & x)

◆ log2()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::log2 ( const T & x)

◆ mul()

dd sw::universal::takum_wide_range::mul ( const dd & a,
const dd & b )
inline

◆ mulmod()

uint64_t sw::universal::takum_wide_range::mulmod ( uint64_t a,
uint64_t b,
uint64_t m )
inline

◆ neg()

dd sw::universal::takum_wide_range::neg ( const dd & a)
inline

◆ one_if_tiny()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::one_if_tiny ( const T & x)

◆ pow() [1/2]

template<typename T>
std::optional< T > sw::universal::takum_wide_range::pow ( const T & x,
const T & y )

◆ pow() [2/2]

template<typename T>
std::optional< T > sw::universal::takum_wide_range::pow ( const T & x,
double y )

◆ pow2mod()

uint64_t sw::universal::takum_wide_range::pow2mod ( uint64_t e,
uint64_t m )
inline

◆ pow_core()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::pow_core ( const T & x,
double dy,
bool yHuge,
bool yTiny,
bool yNegative )

◆ reciprocal_if_tiny()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::reciprocal_if_tiny ( const T & x)

◆ saturated()

template<typename T>
T sw::universal::takum_wide_range::saturated ( bool high,
bool negative )

◆ scaled()

template<typename T>
T sw::universal::takum_wide_range::scaled ( double r,
int64_t k )

◆ scaled_down()

template<typename T>
double sw::universal::takum_wide_range::scaled_down ( const T & x,
int64_t k )

◆ sinh()

template<typename T>
std::optional< T > sw::universal::takum_wide_range::sinh ( const T & x)

◆ two_sum()

dd sw::universal::takum_wide_range::two_sum ( double a,
double b )
inline

Variable Documentation

◆ half_ln_pi_hi

double sw::universal::takum_wide_range::half_ln_pi_hi = 0x1.250d048e7a1bdp-1
inlineconstexpr

◆ half_ln_pi_lo

double sw::universal::takum_wide_range::half_ln_pi_lo = 0x1.7abf2ad8d5088p-58
inlineconstexpr

◆ inv_ln10_hi

double sw::universal::takum_wide_range::inv_ln10_hi = 0x1.bcb7b1526e50ep-2
inlineconstexpr

◆ inv_ln10_lo

double sw::universal::takum_wide_range::inv_ln10_lo = 0x1.95355baaafad3p-57
inlineconstexpr

◆ inv_ln2_hi

double sw::universal::takum_wide_range::inv_ln2_hi = 0x1.71547652b82fep+0
inlineconstexpr

◆ inv_ln2_lo

double sw::universal::takum_wide_range::inv_ln2_lo = 0x1.777d0ffda0d24p-56
inlineconstexpr

◆ ln2_hi

double sw::universal::takum_wide_range::ln2_hi = 0x1.62e42fefa39efp-1
inlineconstexpr

◆ ln2_lo

double sw::universal::takum_wide_range::ln2_lo = 0x1.abc9e3b39803fp-56
inlineconstexpr

◆ ln_2_over_sqrt_pi_hi

double sw::universal::takum_wide_range::ln_2_over_sqrt_pi_hi = 0x1.eeb95b094c191p-4
inlineconstexpr

◆ ln_2_over_sqrt_pi_lo

double sw::universal::takum_wide_range::ln_2_over_sqrt_pi_lo = 0x1.346863f58b075p-58
inlineconstexpr

◆ log2_10_hi

double sw::universal::takum_wide_range::log2_10_hi = 0x1.a934f0979a371p+1
inlineconstexpr

◆ log2_10_lo

double sw::universal::takum_wide_range::log2_10_lo = 0x1.7f2495fb7fa6dp-53
inlineconstexpr