Math functions¶
-
template<precision_t
P>
autompfr::abs(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
The absolute value of the argument.
-
template<precision_t
P>
autompfr::fabs(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
The absolute value of the argument.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::fmod(U const &a, U const &b, long *quotient_ptr = nullptr) noexcept¶ - Return
The remainder of
adivided byb, when the quotient is rounded toward zero. Ifquotient_ptris not null, the least significant bits of the quotient are stored in*quotient_ptr.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::remainder(U const &a, V const &b, long *quotient_ptr = nullptr) noexcept¶ - Return
The remainder of
adivided byb, when the quotient is rounded to the nearest integer. Ifquotient_ptris not null, the least significant bits of the quotient are stored in*quotient_ptr.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::remquo(U const &a, U const &b, long *quotient_ptr) noexcept¶ - Return
The remainder of
adivided byb, when the quotient is rounded to the nearest integer. Ifquotient_ptris not null, the least significant bits of the quotient are stored in*quotient_ptr.
-
template<precision_t
P>
autompfr::fma(mp_float_t<P> const &a, mp_float_t<P> const &b, mp_float_t<P> const &c) noexcept -> mp_float_t<P>¶ - Return
Fused multiply add operation.
a * b + c
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::fmax(U const &a, V const &b) noexcept¶ - Return
Larger of the two arguments. If one of the arguments is NaN, returns the other argument.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::fmin(U const &a, V const &b) noexcept¶ - Return
Smaller of the two arguments. If one of the arguments is NaN, returns the other argument.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::fdim(U const &a, V const &b) noexcept¶ - Return
Positive difference of the two arguments. If one of the arguments is NaN, returns NaN.
-
template<precision_t
P>
autompfr::exp(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Exponential of the argument with base \(e := e^{\text{arg}}\).
-
template<precision_t
P>
autompfr::exp2(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Exponential of the argument with base \(2 := 2^{\text{arg}}\).
-
template<precision_t
P>
autompfr::exp10(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Exponential of the argument with base \(10 := 10^{\text{arg}}\).
-
template<precision_t
P>
autompfr::expm1(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Exponential of the argument with base \(e\) minus 1 \(:= e^{\text{arg}} - 1\).
-
template<precision_t
P>
autompfr::log(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Logarithm of the argument to base \(e := \log_e(\text{arg})\).
-
template<precision_t
P>
autompfr::log10(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Logarithm of the argument to base \(10 := \log_10(\text{arg})\).
-
template<precision_t
P>
autompfr::log2(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Logarithm of the argument to base \(2 := \log_2(\text{arg})\).
-
template<precision_t
P>
autompfr::log1p(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Logarithm to base \(e\) of \(1\) plus the argument \(:=\log_e(1 + \text{arg})\).
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::pow(U const &base, V const &exponent) noexcept¶ - Return
The base to the power of the exponent.
-
template<precision_t
P>
autompfr::sqrt(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Square root of the argument.
-
template<precision_t
P>
autompfr::cbrt(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Cubic root of the argument.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::hypot(U const &x, V const &y) noexcept¶ - Return
Square root of the sum of the squares of the arguments.
-
template<precision_t
P>
autompfr::sin(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Sine of the argument.
-
template<precision_t
P>
autompfr::cos(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Cosine of the argument.
-
template<precision_t
P>
autompfr::tan(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Tangent of the argument.
-
template<precision_t
P>
autompfr::asin(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Inverse of the sine of the argument.
-
template<precision_t
P>
autompfr::acos(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Inverse of the cosine of the argument.
-
template<precision_t
P>
autompfr::atan(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Inverse of the tangent of the argument.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::atan2(U const &y, V const &x) noexcept¶ - Return
Arc tangent of y/x in the correct quadrant depending on the signs of the arguments.
-
template<precision_t
P>
autompfr::sinh(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Hyperbolic sine of the argument.
-
template<precision_t
P>
autompfr::cosh(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Hyperbolic cosine of the argument.
-
template<precision_t
P>
autompfr::tanh(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Hyperbolic tangent of the argument.
-
template<precision_t
P>
autompfr::asinh(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Inverse of the hyperbolic sine of the argument.
-
template<precision_t
P>
autompfr::acosh(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Inverse of the hyperbolic cosine of the argument.
-
template<precision_t
P>
autompfr::atanh(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Inverse of the hyperbolic tangent of the argument.
-
template<precision_t
P>
autompfr::erf(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Error function. [{erf}(x) = {2}{}^x e^{-t^2}{d}t]
-
template<precision_t
P>
autompfr::erfc(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Complementary error function. [{erfc}(x) = 1 - {2}{}^x e^{-t^2}{d}t]
-
template<precision_t
P>
autompfr::tgamma(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Gamma function. [(x) = ^ t^{x-1}e^{-t}{d}t]
-
template<precision_t
P>
autompfr::lgamma(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Natural log of the absolute value of the gamma function.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::beta(U const &x, V const &y) noexcept¶ - Return
Beta function. [{B}(x, y) = ^1 t^{x-1}(1-t)^{y-1} {d}t]
-
template<precision_t
P>
autompfr::expint(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Exponential integral. [{Ei}(x) = {-x}^ {e^{-t}}{t}{d}t]
-
template<precision_t
P>
autompfr::riemann_zeta(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Zeta function.
-
template<precision_t
P>
autompfr::ceil(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Next higher or equal representable integer.
-
template<precision_t
P>
autompfr::floor(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Next lower or equal representable integer.
-
template<precision_t
P>
autompfr::trunc(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Nearest representable integer, rounding toward zero.
-
template<precision_t
P>
autompfr::round(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Nearest representable integer, rounding away from zero.
-
template<precision_t
P>
autompfr::nearbyint(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Nearby int using the current rounding mode.
-
template<precision_t
P>
autompfr::rint(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
Nearby int using the current rounding mode.
-
template<precision_t
P>
autompfr::frexp(mp_float_t<P> const &arg, mpfr_prec_t *exp) noexcept -> mp_float_t<P>¶ Decomposes
arginto a normalized fraction and a power of two.- Return
Normalized fraction. The power of two exponent is stored in
*exp.
-
template<precision_t
P>
autompfr::ldexp(mp_float_t<P> const &arg, long exp) noexcept -> mp_float_t<P>¶ - Return
argmultiplied by two to the power ofexp
-
template<precision_t
P>
autompfr::modf(mp_float_t<P> const &arg, mp_float_t<P> *iptr) noexcept -> mp_float_t<P>¶ - Return
The fractional part of the argument. The value of the integral part is stored in
*iptr.
-
template<precision_t
P>
autompfr::scalbn(mp_float_t<P> const &arg, long exp) noexcept -> mp_float_t<P>¶ - Return
argmultiplied by two to the power ofexp
-
template<precision_t
P>
autompfr::scalbln(mp_float_t<P> const &arg, long exp) noexcept -> mp_float_t<P>¶ - Return
argmultiplied by two to the power ofexp
-
template<precision_t
P>
autompfr::ilogb(mp_float_t<P> const &arg) noexcept -> mpfr_exp_t¶ - Return
The unbiased exponent of the argument. \(\log_2(\lvert\text{arg}\rvert)\)
-
template<precision_t
P>
autompfr::logb(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
The unbiased exponent of the argument. \(\log_2(\lvert\text{arg}\rvert)\)
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::nextafter(U const &from, V const &to) noexcept¶ - Return
The next representable number of
fromin the direction ofto.
-
template<typename
U, typenameV>
sfinae_common_return_typempfr::nexttoward(U const &from, V const &to) noexcept¶ - Return
The next representable number of
fromin the direction ofto.
-
template<precision_t
P>
autompfr::nextabove(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
The next representable number of
fromin the direction of \(+\infty\).
-
template<precision_t
P>
autompfr::nextbelow(mp_float_t<P> const &arg) noexcept -> mp_float_t<P>¶ - Return
The next representable number of
fromin the direction of \(-\infty\).
-
template<typename
U, typenameV>
sfinae_first_param_typempfr::copysign(U const &a, V const &b) noexcept¶ - Return
awith the sign copied fromb.
-
template<precision_t
P>
autompfr::fpclassify(mp_float_t<P> const &arg) noexcept -> fp_class_e¶ - Return
Category of the argument.
-
template<precision_t
P>
autompfr::iszero(mp_float_t<P> const &arg) noexcept -> bool¶ - Return
trueif the argument is zero,falseotherwise.
-
template<precision_t
P>
autompfr::isfinite(mp_float_t<P> const &arg) noexcept -> bool¶ - Return
trueif the argument is finite,falseotherwise.
-
template<precision_t
P>
autompfr::isinf(mp_float_t<P> const &arg) noexcept -> bool¶ - Return
trueif the argument is infinite,falseotherwise.
-
template<precision_t
P>
autompfr::isnan(mp_float_t<P> const &arg) noexcept -> bool¶ - Return
trueif the argument is a NaN,false, otherwise.
-
template<precision_t
P>
autompfr::isnormal(mp_float_t<P> const &arg) noexcept -> bool¶ - Return
trueif the argument is normal. (alwaystrue)
-
template<precision_t
P>
autompfr::signbit(mp_float_t<P> const &arg) noexcept -> bool¶ - Return
trueif the argument is negative,falseotherwise.If the argument is a NaN, detects whether the sign bit is set.
-
template<typename
U, typenameV>
sfinae_boolmpfr::isgreater(U const &a, U const &b)¶ - Return
trueif \(a > b\),falseotherwise.
-
template<typename
U, typenameV>
sfinae_boolmpfr::isgreaterequal(U const &a, V const &b) noexcept¶ - Return
trueif \(a \geq b\),falseotherwise.
-
template<typename
U, typenameV>
sfinae_boolmpfr::isless(U const &a, V const &b) noexcept¶ - Return
trueif \(a < b\),falseotherwise.
-
template<typename
U, typenameV>
sfinae_boolmpfr::islessequal(U const &a, V const &b) noexcept¶ - Return
trueif \(a \leq b\),falseotherwise.
-
template<typename
U, typenameV>
sfinae_boolmpfr::islessgreater(U const &a, V const &b) noexcept¶ - Return
trueif \(a < b\) or \(a > b\),falseotherwise.
-
template<typename
U, typenameV>
sfinae_boolmpfr::isunordered(U const &a, V const &b) noexcept¶ - Return
trueifaorbis NaN,falseotherwise.
-
template<precision_t
P>
structmpfr::sin_cos_result_t¶ Pair of the sine and cosine.
-
template<precision_t
P>
structmpfr::sinh_cosh_result_t¶ Pair of the hyperbolic sine and cosine.
-
template<precision_t
P>
autompfr::sin_cos(mp_float_t<P> const &arg) noexcept -> sin_cos_result_t<P>¶ - Return
Sine and cosine of the argument.
-
template<precision_t
P>
autompfr::sinh_cosh(mp_float_t<P> const &arg) noexcept -> sinh_cosh_result_t<P>¶ - Return
Hyperbolic sine and cosine of the argument.
-
template<precision_t
P>
autompfr::pi_c() noexcept -> mp_float_t<P> const&¶ - Return
\(\pi\) constant.