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

Classes

struct  sw::universal::efloat_detail::ln2_constant< nlimbs >
struct  sw::universal::efloat_detail::ln10_constant< nlimbs >
class  sw::universal::efloat_detail::fixed_series::scratch_space

Namespaces

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

Typedefs

using sw::universal::efloat_detail::limb_buffer = efloat_storage::scratch_limbs<512>
using sw::universal::efloat_detail::fixed_series::limb_t

Enumerations

enum class  sw::universal::efloat_detail::fixed_series::divisors { sw::universal::efloat_detail::fixed_series::exponential , sw::universal::efloat_detail::fixed_series::versine , sw::universal::efloat_detail::fixed_series::arctangent }

Functions

constexpr void sw::universal::efloat_detail::raise_flags (uint32_t flags) noexcept
constexpr RoundingMode sw::universal::efloat_detail::rounding_mode () noexcept
template<unsigned nlimbs>
constexpr unsigned sw::universal::efloat_detail::result_precision (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr unsigned sw::universal::efloat_detail::result_precision (const efloat< nlimbs > &x, const efloat< nlimbs > &y)
template<unsigned nlimbs>
constexpr void sw::universal::efloat_detail::round_result (efloat< nlimbs > &result, unsigned precision, bool carries)
template<unsigned nlimbs>
constexpr bool sw::universal::efloat_detail::can_round (const efloat< nlimbs > &y, unsigned precision, unsigned correct)
template<unsigned nlimbs, typename Evaluate>
constexpr efloat< nlimbs > sw::universal::efloat_detail::round_ziv (Evaluate evaluate, unsigned precision, unsigned error_bits, bool carries)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::round_near (efloat< nlimbs > value, int direction, unsigned precision, bool carries)
template<unsigned nlimbs>
constexpr unsigned sw::universal::efloat_detail::significant_bits (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr bool sw::universal::efloat_detail::is_integer (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr int64_t sw::universal::efloat_detail::integer_value (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exact_power (const efloat< nlimbs > &x, uint64_t n)
template<unsigned nlimbs>
constexpr int64_t sw::universal::efloat_detail::lowest_bit (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::widened (const efloat< nlimbs > &x, unsigned bits)
template<unsigned nlimbs>
constexpr std::size_t sw::universal::efloat_detail::pack_significand (limb_kernels::limb_t *p, const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exact_product (const efloat< nlimbs > &x, const efloat< nlimbs > &y)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exact_sum (const efloat< nlimbs > &a, const efloat< nlimbs > &b, unsigned pad)
template<unsigned nlimbs>
constexpr bool sw::universal::efloat_detail::exp_beyond_range (const efloat< nlimbs > &x, double log2_base)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exp_out_of_range (bool negative, unsigned precision, bool carries)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::atanh_reciprocal (unsigned m, unsigned bits)
template<unsigned nlimbs, typename Compute, typename Cache>
constexpr efloat< nlimbs > sw::universal::efloat_detail::constant_value (unsigned bits, Compute compute, Cache cache)
template<unsigned nlimbs, typename Compute>
efloat< nlimbs > sw::universal::efloat_detail::cached_constant (unsigned bits, Compute compute)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::ln2 (unsigned bits)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::ln10 (unsigned bits)
template<unsigned nlimbs>
constexpr void sw::universal::efloat_detail::fixed_series::to_fixed (const efloat< nlimbs > &v, int64_t shift, limb_t *R, std::size_t n) noexcept
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::fixed_series::from_fixed (const limb_t *A, std::size_t len, int64_t scale)
constexpr void sw::universal::efloat_detail::fixed_series::div_1 (limb_t *q, const limb_t *a, std::size_t n, limb_t d) noexcept
constexpr void sw::universal::efloat_detail::fixed_series::shift_right (limb_t *out, std::size_t outn, const limb_t *a, std::size_t len, uint64_t shift) noexcept
constexpr void sw::universal::efloat_detail::fixed_series::add_or_sub (limb_t *r, const limb_t *a, const limb_t *b, std::size_t n, bool subtract) noexcept
const std::vector< double > & sw::universal::efloat_detail::fixed_series::log2_factorials ()
constexpr double sw::universal::efloat_detail::fixed_series::log2_factorial (unsigned k) noexcept
constexpr limb_t sw::universal::efloat_detail::fixed_series::divisor (divisors kind, limb_t t) noexcept
constexpr double sw::universal::efloat_detail::fixed_series::log2_divisors (divisors kind, unsigned N) noexcept
constexpr unsigned sw::universal::efloat_detail::fixed_series::series_terms (int64_t a, unsigned F, divisors kind=divisors::exponential) noexcept
constexpr unsigned sw::universal::efloat_detail::fixed_series::block_length (unsigned N, divisors kind=divisors::exponential) noexcept
constexpr unsigned sw::universal::efloat_detail::fixed_series::halving_target (unsigned F) noexcept
limb_t * sw::universal::efloat_detail::fixed_series::scratch (std::size_t limbs)
constexpr const limb_t * sw::universal::efloat_detail::fixed_series::truncated_product (const limb_t *a, std::size_t na, const limb_t *b, std::size_t nb, std::size_t drop, limb_t *tmp, limb_t *s) noexcept
constexpr void sw::universal::efloat_detail::fixed_series::series (limb_t *E, const limb_t *R, std::size_t n, bool negative, unsigned N, unsigned m, divisors kind=divisors::exponential, int64_t a=0)
constexpr void sw::universal::efloat_detail::fixed_series::arctangent_series (limb_t *S, const limb_t *Z, std::size_t n, unsigned N, unsigned m, int64_t a, bool alternating=true)
constexpr void sw::universal::efloat_detail::fixed_series::square (limb_t *E, std::size_t n)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exp_working (const efloat< nlimbs > &x, unsigned precision)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::exp_base_working (const efloat< nlimbs > &x, unsigned precision, bool ten)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::efloat_detail::expm1_working (const efloat< nlimbs > &x, unsigned precision)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::exp (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::exp2 (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::exp10 (const efloat< nlimbs > &x)
template<unsigned nlimbs>
constexpr efloat< nlimbs > sw::universal::expm1 (const efloat< nlimbs > &x)

Variables

constexpr unsigned sw::universal::efloat_detail::exp_log_guard_bits = 64u
constexpr unsigned sw::universal::efloat_detail::exp_error_bits = 16u
constexpr double sw::universal::efloat_detail::exp_range_limit = 4611686018427387904.0
constexpr double sw::universal::efloat_detail::log2_e = 1.4426950408889634
constexpr double sw::universal::efloat_detail::log2_10 = 3.321928094887362
constexpr unsigned sw::universal::efloat_detail::fixed_series::log2_factorial_table = 4096
constexpr unsigned sw::universal::efloat_detail::exp_derived_error_bits = exp_error_bits + 4u