pub struct ExactComplex { /* private fields */ }Expand description
Complex value re + i·im with software-limb real and imaginary parts.
Implementations§
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn new(re: ExactNum, im: ExactNum) -> ExactComplex
pub fn new(re: ExactNum, im: ExactNum) -> ExactComplex
Constructs re + i·im.
Sourcepub fn zero(p: usize) -> ExactComplex
pub fn zero(p: usize) -> ExactComplex
0 + 0i at precision p.
Sourcepub fn one(p: usize) -> ExactComplex
pub fn one(p: usize) -> ExactComplex
1 + 0i at precision p.
Sourcepub fn i(p: usize) -> ExactComplex
pub fn i(p: usize) -> ExactComplex
0 + 1i at precision p.
Sourcepub fn set_inexact(&mut self, inexact: bool)
pub fn set_inexact(&mut self, inexact: bool)
Sets the inexact flag on both parts.
Sourcepub fn set_precision(&mut self, p: usize, rm: RoundingMode) -> Result<(), Error>
pub fn set_precision(&mut self, p: usize, rm: RoundingMode) -> Result<(), Error>
Rounds both parts to precision p.
Sourcepub fn from_real(re: ExactNum, p: usize) -> ExactComplex
pub fn from_real(re: ExactNum, p: usize) -> ExactComplex
Real x as x + 0i. Imaginary zero uses precision p.
Sourcepub fn reciprocal(&self, p: usize, rm: RoundingMode) -> ExactComplex
pub fn reciprocal(&self, p: usize, rm: RoundingMode) -> ExactComplex
1 / self.
Sourcepub fn conj(&self) -> ExactComplex
pub fn conj(&self) -> ExactComplex
Complex conjugate.
Sourcepub fn abs(&self, p: usize, rm: RoundingMode) -> ExactNum
pub fn abs(&self, p: usize, rm: RoundingMode) -> ExactNum
Modulus |z| = hypot(re, im) at precision p.
Sourcepub fn arg(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactNum
pub fn arg(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactNum
Argument atan2(im, re) at precision p.
Branch: same as real atan2; values lie in (−π, π]. The cut of ln / sqrt /
pow is the non-positive real axis, approached from above as +π and from below as −π.
Sourcepub fn add(
&self,
rhs: &ExactComplex,
p: usize,
rm: RoundingMode,
) -> ExactComplex
pub fn add( &self, rhs: &ExactComplex, p: usize, rm: RoundingMode, ) -> ExactComplex
self + rhs at precision p.
Sourcepub fn sub(
&self,
rhs: &ExactComplex,
p: usize,
rm: RoundingMode,
) -> ExactComplex
pub fn sub( &self, rhs: &ExactComplex, p: usize, rm: RoundingMode, ) -> ExactComplex
self - rhs at precision p.
Sourcepub fn mul(
&self,
rhs: &ExactComplex,
p: usize,
rm: RoundingMode,
) -> ExactComplex
pub fn mul( &self, rhs: &ExactComplex, p: usize, rm: RoundingMode, ) -> ExactComplex
self * rhs at precision p.
Each of ac, bd, ad, bc is rounded at (p, rm), then ac−bd and
ad+bc are rounded at (p, rm). That matches the MPFR componentwise gold.
Callers that pass RoundingMode::None still keep full products (series paths).
Sourcepub fn div(
&self,
rhs: &ExactComplex,
p: usize,
rm: RoundingMode,
) -> ExactComplex
pub fn div( &self, rhs: &ExactComplex, p: usize, rm: RoundingMode, ) -> ExactComplex
self / rhs at precision p.
Sourcepub fn exp(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn exp(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
e^self using exp(re) (cos(im) + i sin(im)).
Sourcepub fn ln(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn ln(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal logarithm ln|z| + i Arg(z).
Branch cut: (−∞, 0] on the real axis. ln(−1) is iπ (argument +π).
Sourcepub fn sin(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn sin(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
sin(self) via sin(re)cosh(im) + i cos(re)sinh(im).
The complex value is not passed to rem_pi. Only the real (resp. imaginary)
component uses real sin_cos / sinh_cosh.
Sourcepub fn cos(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn cos(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
cos(self) via cos(re)cosh(im) - i sin(re)sinh(im).
Sourcepub fn tan(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn tan(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
tan(self) = sin(self) / cos(self).
Sourcepub fn sinh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn sinh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
sinh(self) via sinh(re)cos(im) + i cosh(re)sin(im).
Sourcepub fn cosh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn cosh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
cosh(self) via cosh(re)cos(im) + i sinh(re)sin(im).
Sourcepub fn tanh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn tanh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
tanh(self) = sinh(self) / cosh(self).
Sourcepub fn sqrt(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn sqrt(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal square root: √r (cos(θ/2) + i sin(θ/2)).
Branch cut: (−∞, 0]. Real part of the result is ≥ 0. sqrt(−1) is +i.
Sourcepub fn log2(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn log2(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
log2(self) = ln(self) / ln 2 (principal branch).
Sourcepub fn log10(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn log10(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
log10(self) = ln(self) / ln 10 (principal branch).
Sourcepub fn log(
&self,
base: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn log( &self, base: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
log_base(self) = ln(self) / ln(base) (principal branch).
Sourcepub fn log1p(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn log1p(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
ln(1 + self) (principal branch).
Sourcepub fn exp2(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn exp2(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
exp2(self) = exp(self · ln 2).
Sourcepub fn exp10(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn exp10(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
exp10(self) = exp(self · ln 10).
Sourcepub fn expm1(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn expm1(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
exp(self) − 1.
Sourcepub fn ldexp(&self, n: i32, p: usize, rm: RoundingMode) -> ExactComplex
pub fn ldexp(&self, n: i32, p: usize, rm: RoundingMode) -> ExactComplex
Scale both parts by 2^n (ldexp on re and im).
Sourcepub fn scalb(&self, n: i32, p: usize, rm: RoundingMode) -> ExactComplex
pub fn scalb(&self, n: i32, p: usize, rm: RoundingMode) -> ExactComplex
Same as ldexp.
Sourcepub fn logb(&self, p: usize, rm: RoundingMode) -> ExactNum
pub fn logb(&self, p: usize, rm: RoundingMode) -> ExactNum
logb(|z|) as a real (x + 0i).
Sourcepub fn nth_root(
&self,
n: usize,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn nth_root( &self, n: usize, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Principal n-th root via exp(ln(z) / n). Inherits the ln branch cut.
Sourcepub fn cbrt(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn cbrt(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal cube root. Same branch as nth_root with n = 3.
Sourcepub fn hypot(
&self,
other: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn hypot( &self, other: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Principal sqrt(self² + other²) (analytic continuation of real hypot).
Sourcepub fn fma(
&self,
b: &ExactComplex,
c: &ExactComplex,
p: usize,
rm: RoundingMode,
) -> ExactComplex
pub fn fma( &self, b: &ExactComplex, c: &ExactComplex, p: usize, rm: RoundingMode, ) -> ExactComplex
self * b + c at extra working precision, then one round (not a fused complex hardware op).
Sourcepub fn mul_add(
&self,
b: &ExactComplex,
c: &ExactComplex,
p: usize,
rm: RoundingMode,
) -> ExactComplex
pub fn mul_add( &self, b: &ExactComplex, c: &ExactComplex, p: usize, rm: RoundingMode, ) -> ExactComplex
Alias of fma.
Sourcepub fn pow(
&self,
rhs: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn pow( &self, rhs: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
self^rhs as exp(rhs * ln(self)) (principal branch).
Inherits the ln cut on self: non-positive real base uses Arg = ±π.
Sourcepub fn asin(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn asin(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal asin: -i ln(i z + √(1 − z²)).
Sourcepub fn acos(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn acos(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal acos: π/2 − asin(z).
Sourcepub fn atan(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn atan(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal atan: (i/2) ln((i+z)/(i−z)).
Sourcepub fn asinh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn asinh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal asinh: ln(z + √(z² + 1)).
Sourcepub fn acosh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn acosh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal acosh: ln(z + √(z−1)√(z+1)).
Sourcepub fn atanh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn atanh(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Principal atanh: (1/2) ln((1+z)/(1−z)).
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn ai(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn ai(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Airy (\mathrm{Ai}(z)). Entire. NaN in → NaN out.
§Precision
- Algorithm: series for
|z| < AIRY_SERIES_THRESHOLD(8); asymptotic otherwise. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn bi(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn bi(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn bessel_j_nu(
&self,
nu: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn bessel_j_nu( &self, nu: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
(J_\nu(z)). Entire for integer (\nu); cut on ((-\infty,0]) otherwise. (z=0) with non-integer (\nu) → NaN.
§Precision
- Algorithm: series for
|z| < BESSEL_SERIES_THRESHOLD(16); Hankel otherwise. Integer|n| ≤ BESSEL_INTEGER_MAX(64). - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn bessel_y(
&self,
nu: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn bessel_y( &self, nu: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
(Y_\nu(z)). Cut on ((-\infty,0]); (z=0) → NaN.
§Precision
- Algorithm: from (J_ν);
BESSEL_SERIES_THRESHOLD = 16. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn bessel_i(
&self,
nu: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn bessel_i( &self, nu: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
(I_\nu(z)=i^{-\nu}J_\nu(iz)). Same cut rules as (J_\nu).
§Precision
- Algorithm: via
Self::bessel_j_nu;BESSEL_SERIES_THRESHOLD = 16. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn bessel_k(
&self,
nu: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn bessel_k( &self, nu: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
(K_\nu(z)=(\pi/2),i^{\nu+1}H_\nu^{(1)}(iz)). Cut on ((-\infty,0]); (z=0) → NaN.
§Precision
- Algorithm: Hankel of (iz);
BESSEL_SERIES_THRESHOLD = 16. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn ei(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn ei(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Exponential integral (\mathrm{Ei}(z)). Cut on ((-\infty,0]); pole at (0) → NaN.
§Precision
- Algorithm: power series for
|z| < EI_SERIES_THRESHOLD(16); asymptotic otherwise. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn si(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn si(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Sourcepub fn ci(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn ci(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Sourcepub fn li(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn li(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Sourcepub fn fresnel_s(
&self,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn fresnel_s( &self, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Fresnel sine integral (S(z)). Entire.
§Precision
- Algorithm: via complex
erf; Ziv on each part (MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn fresnel_c(
&self,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn fresnel_c( &self, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Fresnel cosine integral (C(z)). Entire.
§Precision
- Algorithm: via complex
erf; Ziv on each part (MAX_PREC_RETRY). - MPFR oracle: no.
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn elliptic_k(
&self,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn elliptic_k( &self, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Complete elliptic (K(m)), (m=k^2). Cut on ([1,+\infty)). (m=1) is (+\infty).
§Precision
- Algorithm: Carlson
R_Fin ℂ;CARLSON_DUPE_MAX = 128. - Bound: identities evaluated outside Ziv (nested Ziv would exhaust
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn elliptic_e_complete(
&self,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn elliptic_e_complete( &self, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Complete elliptic (E(m)). (E(1)=1). Cut of (K) inherited through (1-m).
§Precision
- Algorithm: Carlson
R_F/R_D;CARLSON_DUPE_MAX = 128. - Bound: same as
Self::elliptic_k. - MPFR oracle: no.
Sourcepub fn elliptic_f(
&self,
m: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn elliptic_f( &self, m: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Incomplete (F(x|m)), (x=\sin\varphi), (m=k^2).
§Precision
- Algorithm: Carlson
R_F;CARLSON_DUPE_MAX = 128. - MPFR oracle: no.
Carlson (R_F(1-x^2,1-mx^2,1)). Cuts when (1-x^2) or (1-mx^2) lies on ((-\infty,0]) (principal square-root cut). (F(x,0)=\arcsin x).
Sourcepub fn elliptic_e(
&self,
m: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn elliptic_e( &self, m: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Incomplete (E(x|m)). Same (x,m) convention as Self::elliptic_f.
§Precision
- Algorithm: Carlson
R_F/R_D;CARLSON_DUPE_MAX = 128. - MPFR oracle: no. Cuts as for (F). (E(x,0)=\arcsin x); (E(x,1)=x).
Sourcepub fn elliptic_pi_complete(
&self,
m: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn elliptic_pi_complete( &self, m: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Complete (\Pi(n,m)). self is (n). (\Pi(0,m)=K(m)). Pole at (n=1).
§Precision
- Algorithm: Carlson
R_J;CARLSON_DUPE_MAX = 128. - MPFR oracle: no.
Sourcepub fn elliptic_pi(
&self,
x: &ExactComplex,
m: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn elliptic_pi( &self, x: &ExactComplex, m: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Incomplete (\Pi(n;x|m)). self is (n).
§Precision
- Algorithm: Carlson
R_J;CARLSON_DUPE_MAX = 128. - MPFR oracle: no.
Cuts when (1-x^2), (1-mx^2), or (1-nx^2) meets the Carlson cut ((-\infty,0]). (\Pi(0;x|m)=F(x|m)).
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn hypergeom_2f1(
&self,
b: &ExactComplex,
c: &ExactComplex,
z: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn hypergeom_2f1( &self, b: &ExactComplex, c: &ExactComplex, z: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Gaussian ({}_2F_1(a=\mathrm{self},b;c;z)) in (\mathbb{C}).
Series when (\lvert z\rvert<1); Pfaff when (\mathrm{Re}(z)<1/2); Euler / (1-z) and (1/z) linear transforms otherwise. Kummer at (z=1) when (\mathrm{Re}(c-a-b)>0). Cut on ([1,+\infty)) in (z) (principal value from above). Non-positive integer (c) (uncanceled) → NaN.
§Precision
- Algorithm: series / Euler / Pfaff / Kummer. Caps
HYPERGEOM_SERIES_MAX_TERMS = 10_000,HYPERGEOM_TRANSFORM_MAX = 8. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Source§impl ExactComplex
impl ExactComplex
Sourcepub fn erf(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn erf(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Error function (\mathrm{erf}(z)=1-\mathrm{erfc}(z)). Entire; NaN in → NaN out.
§Precision
- Algorithm: Faddeeva
w(z)series for|z|belowFADDEEVA_SERIES_L1 = 8; continued fraction otherwise. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: real axis vs
mpfr_erf. GNU MPC has nompc_erf. Off-axis:erfodd,erfc=1-erf.
Sourcepub fn erfc(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn erfc(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Sourcepub fn gamma(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
pub fn gamma(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
Gamma (\Gamma(z)). Poles at non-positive integers → NaN.
§Precision
- Algorithm: Stirling (
GAMMA_STIRLING_TERMS = 64) plus reflection; factorial for small integers (GAMMA_FACTORIAL_MAX = 64). - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: real axis vs
mpfr_gamma. GNU MPC has nompc_gamma. Integers:Γ(n)=(n-1)!.
Sourcepub fn ln_gamma(
&self,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn ln_gamma( &self, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Principal (\ln\Gamma(z)). Cut on ((-\infty,0]); poles → NaN. Equals (\ln(\Gamma(z))) with the principal logarithm.
§Precision
- Algorithm: Stirling (
GAMMA_STIRLING_TERMS = 64) plus reflection. - Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Sourcepub fn digamma(
&self,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
pub fn digamma( &self, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
Digamma (\psi(z)=\Gamma’/\Gamma). Poles at non-positive integers → NaN.
§Precision
- Algorithm: recurrence plus Bernoulli; reflection for (\operatorname{Re} z < 0).
- Bound: Ziv on each part (
MAX_PREC_RETRY). - MPFR oracle: no.
Trait Implementations§
Source§impl Add for ExactComplex
impl Add for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
+ operator.Source§fn add(self, rhs: ExactComplex) -> ExactComplex
fn add(self, rhs: ExactComplex) -> ExactComplex
+ operation. Read moreSource§impl Add<&ExactComplex> for &ExactComplex
impl Add<&ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
+ operator.Source§fn add(self, rhs: &ExactComplex) -> ExactComplex
fn add(self, rhs: &ExactComplex) -> ExactComplex
+ operation. Read moreSource§impl Add<&ExactComplex> for ExactComplex
impl Add<&ExactComplex> for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
+ operator.Source§fn add(self, rhs: &ExactComplex) -> ExactComplex
fn add(self, rhs: &ExactComplex) -> ExactComplex
+ operation. Read moreSource§impl Add<ExactComplex> for &ExactComplex
impl Add<ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
+ operator.Source§fn add(self, rhs: ExactComplex) -> ExactComplex
fn add(self, rhs: ExactComplex) -> ExactComplex
+ operation. Read moreSource§impl Clone for ExactComplex
impl Clone for ExactComplex
Source§fn clone(&self) -> ExactComplex
fn clone(&self) -> ExactComplex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExactComplex
impl Debug for ExactComplex
Source§impl Div for ExactComplex
impl Div for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
/ operator.Source§fn div(self, rhs: ExactComplex) -> ExactComplex
fn div(self, rhs: ExactComplex) -> ExactComplex
/ operation. Read moreSource§impl Div<&ExactComplex> for &ExactComplex
impl Div<&ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
/ operator.Source§fn div(self, rhs: &ExactComplex) -> ExactComplex
fn div(self, rhs: &ExactComplex) -> ExactComplex
/ operation. Read moreSource§impl Div<&ExactComplex> for ExactComplex
impl Div<&ExactComplex> for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
/ operator.Source§fn div(self, rhs: &ExactComplex) -> ExactComplex
fn div(self, rhs: &ExactComplex) -> ExactComplex
/ operation. Read moreSource§impl Div<ExactComplex> for &ExactComplex
impl Div<ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
/ operator.Source§fn div(self, rhs: ExactComplex) -> ExactComplex
fn div(self, rhs: ExactComplex) -> ExactComplex
/ operation. Read moreSource§impl FromExt<&ExactComplex> for ExactComplex
impl FromExt<&ExactComplex> for ExactComplex
Source§fn from_ext(
v: &ExactComplex,
p: usize,
rm: RoundingMode,
cc: &mut Consts,
) -> ExactComplex
fn from_ext( v: &ExactComplex, p: usize, rm: RoundingMode, cc: &mut Consts, ) -> ExactComplex
v to ExactNum with precision p using rounding mode rm.Source§impl FromExt<ExactComplex> for ExactComplex
impl FromExt<ExactComplex> for ExactComplex
Source§fn from_ext(
v: ExactComplex,
p: usize,
rm: RoundingMode,
_cc: &mut Consts,
) -> ExactComplex
fn from_ext( v: ExactComplex, p: usize, rm: RoundingMode, _cc: &mut Consts, ) -> ExactComplex
v to ExactNum with precision p using rounding mode rm.Source§impl<T> FromExt<T> for ExactComplex
impl<T> FromExt<T> for ExactComplex
Source§fn from_ext(v: T, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
fn from_ext(v: T, p: usize, rm: RoundingMode, cc: &mut Consts) -> ExactComplex
v to ExactNum with precision p using rounding mode rm.Source§impl Mul for ExactComplex
impl Mul for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
* operator.Source§fn mul(self, rhs: ExactComplex) -> ExactComplex
fn mul(self, rhs: ExactComplex) -> ExactComplex
* operation. Read moreSource§impl Mul<&ExactComplex> for &ExactComplex
impl Mul<&ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
* operator.Source§fn mul(self, rhs: &ExactComplex) -> ExactComplex
fn mul(self, rhs: &ExactComplex) -> ExactComplex
* operation. Read moreSource§impl Mul<&ExactComplex> for ExactComplex
impl Mul<&ExactComplex> for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
* operator.Source§fn mul(self, rhs: &ExactComplex) -> ExactComplex
fn mul(self, rhs: &ExactComplex) -> ExactComplex
* operation. Read moreSource§impl Mul<ExactComplex> for &ExactComplex
impl Mul<ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
* operator.Source§fn mul(self, rhs: ExactComplex) -> ExactComplex
fn mul(self, rhs: ExactComplex) -> ExactComplex
* operation. Read moreSource§impl Sub for ExactComplex
impl Sub for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
- operator.Source§fn sub(self, rhs: ExactComplex) -> ExactComplex
fn sub(self, rhs: ExactComplex) -> ExactComplex
- operation. Read moreSource§impl Sub<&ExactComplex> for &ExactComplex
impl Sub<&ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
- operator.Source§fn sub(self, rhs: &ExactComplex) -> ExactComplex
fn sub(self, rhs: &ExactComplex) -> ExactComplex
- operation. Read moreSource§impl Sub<&ExactComplex> for ExactComplex
impl Sub<&ExactComplex> for ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
- operator.Source§fn sub(self, rhs: &ExactComplex) -> ExactComplex
fn sub(self, rhs: &ExactComplex) -> ExactComplex
- operation. Read moreSource§impl Sub<ExactComplex> for &ExactComplex
impl Sub<ExactComplex> for &ExactComplex
Source§type Output = ExactComplex
type Output = ExactComplex
- operator.Source§fn sub(self, rhs: ExactComplex) -> ExactComplex
fn sub(self, rhs: ExactComplex) -> ExactComplex
- operation. Read moreAuto Trait Implementations§
impl Freeze for ExactComplex
impl RefUnwindSafe for ExactComplex
impl Send for ExactComplex
impl Sync for ExactComplex
impl Unpin for ExactComplex
impl UnsafeUnpin for ExactComplex
impl UnwindSafe for ExactComplex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more