Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Namespaces | Functions
mpreal_functions.hpp File Reference
#include "detail/math_integer.hpp"
#include "math_results.hpp"
#include "mpreal.hpp"
#include <cstdint>
Include dependency graph for mpreal_functions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  uni20
 

Functions

mpreal uni20::ceil (mpreal const &x)
 Round toward positive infinity; exact inputs produce exact integers.
 
mpreal uni20::ceil (mpreal const &x, Precision p)
 Round toward positive infinity, then round the result to finite precision p.
 
template<detail::MathInteger I>
mpreal uni20::compound (mpreal const &x, I n)
 Compute (1+x)^n without rounding the sum first, for x >= -1.
 
template<detail::MathInteger I>
mpreal uni20::compound (mpreal const &x, I n, Precision p)
 Round the compound result from the original input to finite precision p.
 
mpreal uni20::copysign (mpreal const &magnitude, mpreal const &sign)
 Transfer the sign while preserving the magnitude's precision and exactness.
 
mpreal uni20::copysign (mpreal const &magnitude, mpreal const &sign, Precision p)
 Round the magnitude to p and transfer the sign; sign precision is immaterial.
 
mpreal uni20::fdim (mpreal const &a, mpreal const &b)
 Positive difference max(a-b,0), propagating NaNs.
 
mpreal uni20::fdim (mpreal const &a, mpreal const &b, Precision p)
 Positive difference with one rounding at p, without input conversion.
 
mpreal uni20::floor (mpreal const &x)
 Round toward negative infinity; exact inputs produce exact integers.
 
mpreal uni20::floor (mpreal const &x, Precision p)
 Round toward negative infinity, then round the result to finite precision p.
 
mpreal uni20::fma (mpreal const &a, mpreal const &b, mpreal const &c)
 Compute a*b+c with one rounding, including mixed exact rational operands.
 
mpreal uni20::fma (mpreal const &a, mpreal const &b, mpreal const &c, Precision p)
 Round a*b+c once at p, without converting operands first.
 
mpreal uni20::fmax (mpreal const &a, mpreal const &b)
 Maximum with NaN suppression and positive-zero preference.
 
mpreal uni20::fmax (mpreal const &a, mpreal const &b, Precision p)
 Select the maximum before rounding it to result precision p.
 
mpreal uni20::fmin (mpreal const &a, mpreal const &b)
 Minimum with NaN suppression and negative-zero preference.
 
mpreal uni20::fmin (mpreal const &a, mpreal const &b, Precision p)
 Select the minimum before rounding it to result precision p.
 
mpreal uni20::fmod (mpreal const &a, mpreal const &b)
 Truncating-quotient remainder; exact operands retain exact rational results.
 
mpreal uni20::fmod (mpreal const &a, mpreal const &b, Precision p)
 Truncating-quotient remainder, rounding only the result at p.
 
frexp_result< mpreal > uni20::frexp (mpreal const &x)
 Decompose into a binary fraction and signed 64-bit exponent.
 
frexp_result< mpreal > uni20::frexp (mpreal const &x, Precision p)
 Decompose and round the fraction at p, normalizing any rounding carry.
 
std::int64_t uni20::ilogb (mpreal const &x)
 Base-two exponent of a finite nonzero value.
 
template<detail::MathInteger I>
mpreal uni20::ldexp (mpreal const &x, I exponent)
 Multiply by 2^exponent, preserving exact rational state or input precision.
 
template<detail::MathInteger I>
mpreal uni20::ldexp (mpreal const &x, I exponent, Precision p)
 Multiply the original value by 2^exponent and round the result at p.
 
modf_result< mpreal > uni20::modf (mpreal const &x)
 Signed fractional and integral parts, using truncation toward zero.
 
modf_result< mpreal > uni20::modf (mpreal const &x, Precision p)
 Decompose the original value and round each result component at p.
 
mpreal uni20::next_down (mpreal const &x)
 Next value toward negative infinity on the input's finite grid.
 
mpreal uni20::next_down (mpreal const &x, Precision p)
 Select grid p by rounding x, then move toward negative infinity.
 
mpreal uni20::next_up (mpreal const &x)
 Next value toward positive infinity on the input's finite grid.
 
mpreal uni20::next_up (mpreal const &x, Precision p)
 Select grid p by rounding x, then move toward positive infinity.
 
mpreal uni20::nextafter (mpreal const &x, mpreal const &direction)
 Adjacent value on x's grid toward direction, whose precision may differ.
 
mpreal uni20::nextafter (mpreal const &x, mpreal const &direction, Precision p)
 Round x onto grid p, then step toward the unrounded direction.
 
template<detail::MathInteger I>
mpreal uni20::pown (mpreal const &x, I exponent)
 Integer power, preserving exact rational results or the input's finite precision.
 
template<detail::MathInteger I>
mpreal uni20::pown (mpreal const &x, I exponent, Precision p)
 Integer power with one final rounding at p, without input conversion.
 
mpreal uni20::remainder (mpreal const &a, mpreal const &b)
 Nearest-even-quotient remainder; exact operands retain exact rational results.
 
mpreal uni20::remainder (mpreal const &a, mpreal const &b, Precision p)
 Nearest-even-quotient remainder, rounding only the result at p.
 
remquo_result< mpreal > uni20::remquo (mpreal const &a, mpreal const &b)
 Nearest-even remainder with the signed low three quotient bits.
 
remquo_result< mpreal > uni20::remquo (mpreal const &a, mpreal const &b, Precision p)
 Remainder and quotient bits computed before rounding the remainder at p.
 
template<detail::MathInteger I>
mpreal uni20::rootn (mpreal const &x, I degree)
 Real integer-order root; negative orders give reciprocal roots.
 
template<detail::MathInteger I>
mpreal uni20::rootn (mpreal const &x, I degree, Precision p)
 Integer-order root with one final rounding at p, without input conversion.
 
mpreal uni20::round (mpreal const &x)
 Round to nearest integer, with ties away from zero; exact inputs produce exact integers.
 
mpreal uni20::round (mpreal const &x, Precision p)
 Round to nearest integer, with ties away from zero, then round the result to finite precision p.
 
mpreal uni20::round_even (mpreal const &x)
 Round to nearest integer, with ties to even; exact inputs produce exact integers.
 
mpreal uni20::round_even (mpreal const &x, Precision p)
 Round to nearest integer, with ties to even, then round the result to finite precision p.
 
template<detail::MathInteger I>
mpreal uni20::scalbn (mpreal const &x, I exponent)
 Binary scaling, identical to ldexp for Uni20's binary scalar formats.
 
template<detail::MathInteger I>
mpreal uni20::scalbn (mpreal const &x, I exponent, Precision p)
 Binary scaling with one rounding to finite result precision p.
 
sincos_result< mpreal > uni20::sincos (mpreal const &x)
 Evaluate sine and cosine using the paired provider routine.
 
sincos_result< mpreal > uni20::sincos (mpreal const &x, Precision p)
 Paired elementary evaluation at p, matching sin(x,p) and cos(x,p).
 
sinhcosh_result< mpreal > uni20::sinhcosh (mpreal const &x)
 Evaluate hyperbolic sine and cosine using the paired provider routine.
 
sinhcosh_result< mpreal > uni20::sinhcosh (mpreal const &x, Precision p)
 Paired elementary evaluation at p, matching sinh(x,p) and cosh(x,p).
 
mpreal uni20::trunc (mpreal const &x)
 Round toward zero; exact inputs produce exact integers.
 
mpreal uni20::trunc (mpreal const &x, Precision p)
 Round toward zero, then round the result to finite precision p.