Skip to main content

ComplexSpecialFunctions

Struct ComplexSpecialFunctions 

Source
pub struct ComplexSpecialFunctions;
Expand description

Complex special functions.

Implementations§

Source§

impl ComplexSpecialFunctions

Source

pub fn gamma(z: Complex) -> Complex

Complex gamma function using Lanczos approximation.

Source

pub fn digamma(z: Complex) -> Complex

Complex digamma function (derivative of log gamma).

Source

pub fn zeta(z: Complex, iterations: usize) -> Complex

Riemann zeta function for complex arguments.

Source

pub fn polylog(s: Complex, z: Complex, iterations: usize) -> Complex

Polylogarithm Li_s(z).

Computed from the defining series, which converges absolutely for |z| < 1 (and conditionally on |z| = 1 when Re(s) > 1).

For |z| > 1 the analytic continuation is not implemented (the naive inversion series is numerically unreliable for general complex s); NaN is returned rather than silently wrong values.

Source

pub fn erf(z: Complex, iterations: usize) -> Complex

Complex error function.

Taylor series for |z| < 3; asymptotic expansion with optimal truncation for |z| ≥ 3 (where the Taylor series needs hundreds of terms to converge).

Source

pub fn erfc(z: Complex, iterations: usize) -> Complex

Complex complementary error function.

Uses the direct asymptotic form for large |z| so that erfc does not suffer catastrophic cancellation inside 1 − erf(z).

Source

pub fn exponential_integral(z: Complex, iterations: usize) -> Complex

Complex exponential integral Ei(z).

Source

pub fn fresnel(z: Complex, iterations: usize) -> (Complex, Complex)

Complex Fresnel integrals C(z) and S(z).

Convention without π/2 factors: C(z) = Σ (-1)^n z^(4n+1)/((2n)! (4n+1)), S(z) = Σ (-1)^n z^(4n+3)/((2n+1)! (4n+3)).

Source

pub fn airy(z: Complex, iterations: usize) -> (Complex, Complex)

Complex Airy functions Ai(z) and Bi(z).

Ai(z) = c1·f(z) - c2·g(z), Bi(z) = √3·(c1·f(z) + c2·g(z)) with f(z) = Σ z^(3k)/(9^k k! Γ(k+2/3)), g(z) = Σ z^(3k+1)/(9^k k! Γ(k+4/3)), c1 = 3^(-2/3), c2 = 3^(-4/3).

Source

pub fn bessel_j(v: Complex, z: Complex, iterations: usize) -> Complex

Complex Bessel function of the first kind J_v(z).

Source

pub fn bessel_y(v: Complex, z: Complex, iterations: usize) -> Complex

Complex Bessel function of the second kind Y_v(z).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.