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::ereal_detail Namespace Reference

Classes

struct  scaled_limb
struct  scaled_value
struct  inverse_two_pi_table

Typedefs

using reduction_int = einteger<std::uint32_t>

Functions

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > parse_constant (const char *digits)
template<unsigned maxlimbs, typename FpType, std::size_t N>
ereal< maxlimbs, FpType > from_limbs (const scaled_limb(&components)[N])
template<unsigned n, unsigned m, typename FpType>
ereal< n, FpType > convert_limbs (const ereal< m, FpType > &v)
template<typename FpType>
constexpr unsigned max_ereal_limbs ()
template<unsigned maxlimbs, typename FpType>
constexpr unsigned erfc_wide_limbs ()
double erfc_bits (double x2)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > two_over_sqrt_pi ()
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > scaled_exp_minus (const ereal< maxlimbs, FpType > &x2, long long &n)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > erf_series (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
bool erfc_asymptotic_reaches (double x2)
template<typename FpType>
bool erf_series_overflows (double x2)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > erfc_asymptotic (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
double erfc_fraction_steps (double x)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > erfc_continued_fraction (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > erfc_positive (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
constexpr int stirling_z0 ()
template<unsigned maxlimbs, typename FpType>
void normalize (scaled_value< maxlimbs, FpType > &v)
template<unsigned maxlimbs, typename FpType>
const std::vector< scaled_value< maxlimbs, FpType > > & stirling_coefficients ()
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > half_log_two_pi ()
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > lgamma_positive (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
bool is_gamma_pole (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > lgamma_abs (const ereal< maxlimbs, FpType > &x, bool &negative)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > remainder_by_zero ()
template<unsigned maxlimbs, typename FpType>
std::vector< FpType > exact_remainder_expansion (const ereal< maxlimbs, FpType > &a, const ereal< maxlimbs, FpType > &b, bool &odd)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > from_expansion (std::vector< FpType > e)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > exact_remainder (const ereal< maxlimbs, FpType > &a, const ereal< maxlimbs, FpType > &b, bool &odd)
template<unsigned maxlimbs, typename FpType, std::size_t n>
ereal< maxlimbs, FpType > scaled_hypot (const ereal< maxlimbs, FpType >(&a)[n])
reduction_int atan_inverse_fixed (long long k, int W)
reduction_int inverse_two_pi_bits (int nbits)
template<typename FpType>
void exact_dyadic (FpType v, reduction_int &S, int &e)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > einteger_to_ereal (const reduction_int &n, int scale, int keep)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > payne_hanek_two_pi (const ereal< maxlimbs, FpType > &a, const ereal< maxlimbs, FpType > &two_pi)
 a - 2 pi n in [-pi, pi), n the nearest integer to a / (2 pi), for a finite a
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > signed_zero (bool negative)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > signed_inf (bool negative)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > quiet_nan ()
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > zero_with_sign_of (const ereal< maxlimbs, FpType > &r, const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > square_safe_limit ()
template<unsigned maxlimbs, typename FpType>
bool is_integer (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
bool is_odd_integer (const ereal< maxlimbs, FpType > &x)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > reduce_two_pi (const ereal< maxlimbs, FpType > &a, const ereal< maxlimbs, FpType > &pi)
template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > atan_taylor (const ereal< maxlimbs, FpType > &x)

Variables

static constexpr scaled_limb ereal_pi_limbs []
static constexpr scaled_limb ereal_ln2_limbs []
static constexpr scaled_limb ereal_ln10_limbs []

Typedef Documentation

◆ reduction_int

Function Documentation

◆ atan_inverse_fixed()

reduction_int sw::universal::ereal_detail::atan_inverse_fixed ( long long k,
int W )
inline

◆ atan_taylor()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::atan_taylor ( const ereal< maxlimbs, FpType > & x)
inline

◆ convert_limbs()

template<unsigned n, unsigned m, typename FpType>
ereal< n, FpType > sw::universal::ereal_detail::convert_limbs ( const ereal< m, FpType > & v)
inline

◆ einteger_to_ereal()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::einteger_to_ereal ( const reduction_int & n,
int scale,
int keep )
inline

◆ erf_series()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::erf_series ( const ereal< maxlimbs, FpType > & x)
inline

◆ erf_series_overflows()

template<typename FpType>
bool sw::universal::ereal_detail::erf_series_overflows ( double x2)
inline

◆ erfc_asymptotic()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::erfc_asymptotic ( const ereal< maxlimbs, FpType > & x)
inline

◆ erfc_asymptotic_reaches()

template<unsigned maxlimbs, typename FpType>
bool sw::universal::ereal_detail::erfc_asymptotic_reaches ( double x2)
inline

◆ erfc_bits()

double sw::universal::ereal_detail::erfc_bits ( double x2)
inline

◆ erfc_continued_fraction()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::erfc_continued_fraction ( const ereal< maxlimbs, FpType > & x)
inline

◆ erfc_fraction_steps()

template<unsigned maxlimbs, typename FpType>
double sw::universal::ereal_detail::erfc_fraction_steps ( double x)
inline

◆ erfc_positive()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::erfc_positive ( const ereal< maxlimbs, FpType > & x)
inline

◆ erfc_wide_limbs()

template<unsigned maxlimbs, typename FpType>
unsigned sw::universal::ereal_detail::erfc_wide_limbs ( )
inlineconstexpr

◆ exact_dyadic()

template<typename FpType>
void sw::universal::ereal_detail::exact_dyadic ( FpType v,
reduction_int & S,
int & e )
inline

◆ exact_remainder()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::exact_remainder ( const ereal< maxlimbs, FpType > & a,
const ereal< maxlimbs, FpType > & b,
bool & odd )
inline

◆ exact_remainder_expansion()

template<unsigned maxlimbs, typename FpType>
std::vector< FpType > sw::universal::ereal_detail::exact_remainder_expansion ( const ereal< maxlimbs, FpType > & a,
const ereal< maxlimbs, FpType > & b,
bool & odd )
inline

◆ from_expansion()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::from_expansion ( std::vector< FpType > e)
inline

◆ from_limbs()

template<unsigned maxlimbs, typename FpType, std::size_t N>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::from_limbs ( const scaled_limb(&) components[N])
inline

◆ half_log_two_pi()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::half_log_two_pi ( )
inline

◆ inverse_two_pi_bits()

reduction_int sw::universal::ereal_detail::inverse_two_pi_bits ( int nbits)
inline

◆ is_gamma_pole()

template<unsigned maxlimbs, typename FpType>
bool sw::universal::ereal_detail::is_gamma_pole ( const ereal< maxlimbs, FpType > & x)
inline

◆ is_integer()

template<unsigned maxlimbs, typename FpType>
bool sw::universal::ereal_detail::is_integer ( const ereal< maxlimbs, FpType > & x)
inline

◆ is_odd_integer()

template<unsigned maxlimbs, typename FpType>
bool sw::universal::ereal_detail::is_odd_integer ( const ereal< maxlimbs, FpType > & x)
inline

◆ lgamma_abs()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::lgamma_abs ( const ereal< maxlimbs, FpType > & x,
bool & negative )
inline

◆ lgamma_positive()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::lgamma_positive ( const ereal< maxlimbs, FpType > & x)
inline

◆ max_ereal_limbs()

template<typename FpType>
unsigned sw::universal::ereal_detail::max_ereal_limbs ( )
inlineconstexpr

◆ normalize()

template<unsigned maxlimbs, typename FpType>
void sw::universal::ereal_detail::normalize ( scaled_value< maxlimbs, FpType > & v)
inline

◆ parse_constant()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::parse_constant ( const char * digits)
inline

◆ payne_hanek_two_pi()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::payne_hanek_two_pi ( const ereal< maxlimbs, FpType > & a,
const ereal< maxlimbs, FpType > & two_pi )
inline

a - 2 pi n in [-pi, pi), n the nearest integer to a / (2 pi), for a finite a

◆ quiet_nan()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::quiet_nan ( )
inline

◆ reduce_two_pi()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::reduce_two_pi ( const ereal< maxlimbs, FpType > & a,
const ereal< maxlimbs, FpType > & pi )
inline

◆ remainder_by_zero()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::remainder_by_zero ( )
inline

◆ scaled_exp_minus()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::scaled_exp_minus ( const ereal< maxlimbs, FpType > & x2,
long long & n )
inline

◆ scaled_hypot()

template<unsigned maxlimbs, typename FpType, std::size_t n>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::scaled_hypot ( const ereal< maxlimbs, FpType >(&) a[n])
inline

◆ signed_inf()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::signed_inf ( bool negative)
inline

◆ signed_zero()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::signed_zero ( bool negative)
inline

◆ square_safe_limit()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::square_safe_limit ( )
inline

◆ stirling_coefficients()

template<unsigned maxlimbs, typename FpType>
const std::vector< scaled_value< maxlimbs, FpType > > & sw::universal::ereal_detail::stirling_coefficients ( )
inline

◆ stirling_z0()

template<unsigned maxlimbs, typename FpType>
int sw::universal::ereal_detail::stirling_z0 ( )
inlineconstexpr

◆ two_over_sqrt_pi()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::two_over_sqrt_pi ( )
inline

◆ zero_with_sign_of()

template<unsigned maxlimbs, typename FpType>
ereal< maxlimbs, FpType > sw::universal::ereal_detail::zero_with_sign_of ( const ereal< maxlimbs, FpType > & r,
const ereal< maxlimbs, FpType > & x )
inline

Variable Documentation

◆ ereal_ln10_limbs

scaled_limb sw::universal::ereal_detail::ereal_ln10_limbs[]
staticconstexpr

◆ ereal_ln2_limbs

scaled_limb sw::universal::ereal_detail::ereal_ln2_limbs[]
staticconstexpr

◆ ereal_pi_limbs

scaled_limb sw::universal::ereal_detail::ereal_pi_limbs[]
staticconstexpr