Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
error_and_gamma.hpp File Reference
#include <algorithm>
#include <bit>
#include <cstdint>
#include <type_traits>
#include <vector>

Classes

struct  sw::universal::efloat_detail::two_over_sqrt_pi_constant< nlimbs >
struct  sw::universal::efloat_detail::half_log_2pi_constant< nlimbs >

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal
namespace  sw::universal::efloat_detail
 decimal formatting (binary -> decimal string at arbitrary precision)

Functions

template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::two_over_sqrt_pi (unsigned bits)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exact_square (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::erf_series (const efloat< nlimbs > &x, const efloat< nlimbs > &x2, unsigned W)
constexpr bool sw::universal::efloat_detail::erfc_asymptotic_reaches (double x2, unsigned W)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::erfc_asymptotic (const efloat< nlimbs > &x, const efloat< nlimbs > &x2, unsigned W)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::erf_working (const efloat< nlimbs > &x, unsigned target)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::erfc_working (const efloat< nlimbs > &x, unsigned target)
template<unsigned nlimbs>
constexpr bool sw::universal::efloat_detail::erfc_negligible (const efloat< nlimbs > &x, unsigned precision)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::erf (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::erfc (const efloat< nlimbs > &x)
constexpr double sw::universal::efloat_detail::stirling_log2_term (unsigned k, double log2z)
constexpr unsigned sw::universal::efloat_detail::stirling_terms (double log2z, unsigned W)
template<unsigned nlimbs>
constexpr std::vector< efloat< nlimbs > > sw::universal::efloat_detail::stirling_compute (unsigned m, unsigned bits)
template<unsigned nlimbs>
const std::vector< efloat< nlimbs > > & sw::universal::efloat_detail::stirling_coefficients (unsigned m, unsigned bits)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::half_log_2pi (unsigned bits)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::stirling_sum (const efloat< nlimbs > &z, double log2z, unsigned m, unsigned W)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::shift_product (const efloat< nlimbs > &x, int64_t N, unsigned W)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::lgamma_positive (const efloat< nlimbs > &x, unsigned W, int64_t &E)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::lgamma_abs (const efloat< nlimbs > &x, unsigned W, int64_t &E, bool &negative)
template<unsigned nlimbs>
constexpr int64_t sw::universal::efloat_detail::lgamma_parts_scale (const efloat< nlimbs > &x, unsigned W)
template<unsigned nlimbs>
constexpr int64_t sw::universal::efloat_detail::lgamma_scale_estimate (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr int64_t sw::universal::efloat_detail::lgamma_precision (const efloat< nlimbs > &x, int64_t needed)
template<unsigned nlimbs>
constexpr int64_t sw::universal::efloat_detail::tgamma_precision (const efloat< nlimbs > &x, int64_t needed)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::lgamma_working (const efloat< nlimbs > &x, unsigned target)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::tgamma_working (const efloat< nlimbs > &x, unsigned target)
template<unsigned nlimbs>
constexpr bool sw::universal::efloat_detail::exact_factorial (int64_t n, unsigned limit, efloat< nlimbs > &result)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::tgamma (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::lgamma (const efloat< nlimbs > &x)

Variables

constexpr unsigned sw::universal::efloat_detail::erf_guard_bits = 32u
constexpr unsigned sw::universal::efloat_detail::erf_error_bits = 0u
constexpr double sw::universal::efloat_detail::gamma_shift_per_bit = 0.15
constexpr unsigned sw::universal::efloat_detail::gamma_error_bits = 22u
constexpr unsigned sw::universal::efloat_detail::gamma_shift_group = 8u