special::notation
The functions under the names of the textbooks: Γ(x), ψ(x),
ζ(s), J₀(x), Φ⁻¹(p). Greek letters, subscript digits, primes and
superscripts are identifier characters, so these are plain functions,
each the same as the ASCII one it names. Import the ones you want
(use special::notation::{Γ, ψ}) or all of them
(use special::notation::*).
Functions
ΓSource
pub fn Γ(x: f64) -> f64 Γ(x): special::gamma.
use special::notation::Γ;
assert(Γ(5.0) == 24.0);
lnΓSource
pub fn lnΓ(x: f64) -> f64 lnΓ(x): special::lgamma.
use special::notation::lnΓ;
assert(lnΓ(2.0) == 0.0);
ψSource
pub fn ψ(x: f64) -> f64 ψ(x): the digamma function, special::digamma.
use special::notation::ψ;
assert((ψ(1.0) + 0.5772156649015329).abs() < 1e-16);
ψSource
pub fn ψ′(x: f64) -> f64 ψ′(x): the trigamma function, special::trigamma.
use special::notation::ψ′;
assert((ψ′(1.0) - 1.6449340668482264).abs() < 1e-15);
ΒSource
pub fn Β(a: f64, b: f64) -> f64 Β(a, b) (a capital beta, U+0392): special::beta.
use special::notation::Β;
assert((Β(2.0, 3.0) - 1.0 / 12.0).abs() < 1e-17);
ΦSource
pub fn Φ(x: f64) -> f64 Φ(x): the standard normal CDF, special::ndtr.
use special::notation::Φ;
assert(Φ(0.0) == 0.5);
ΦSource
pub fn Φ⁻¹(p: f64) -> f64 Φ⁻¹(p): the standard normal quantile, special::ndtri.
use special::notation::{Φ, Φ⁻¹};
assert((Φ(Φ⁻¹(0.3)) - 0.3).abs() < 1e-16);
erfSource
pub fn erf⁻¹(y: f64) -> f64 erf⁻¹(y): special::erfinv.
use special::notation::erf⁻¹;
assert(erf⁻¹(0.0) == 0.0);
J₀Source
pub fn J₀(x: f64) -> f64 J₀(x): special::j0.
use special::notation::J₀;
assert(J₀(0.0) == 1.0);
J₁Source
pub fn J₁(x: f64) -> f64 J₁(x): special::j1.
use special::notation::J₁;
assert(J₁(0.0) == 0.0);
Y₀Source
pub fn Y₀(x: f64) -> f64 Y₀(x): special::y0.
use special::notation::Y₀;
assert(Y₀(0.0) == f64::NEG_INFINITY);
Y₁Source
pub fn Y₁(x: f64) -> f64 Y₁(x): special::y1.
use special::notation::Y₁;
assert(Y₁(0.0) == f64::NEG_INFINITY);
I₀Source
pub fn I₀(x: f64) -> f64 I₀(x): special::i0.
use special::notation::I₀;
assert(I₀(0.0) == 1.0);
I₁Source
pub fn I₁(x: f64) -> f64 I₁(x): special::i1.
use special::notation::I₁;
assert(I₁(0.0) == 0.0);
K₀Source
pub fn K₀(x: f64) -> f64 K₀(x): special::k0.
use special::notation::K₀;
assert(K₀(0.0) == f64::INFINITY);
K₁Source
pub fn K₁(x: f64) -> f64 K₁(x): special::k1.
use special::notation::K₁;
assert(K₁(0.0) == f64::INFINITY);
AiSource
pub fn Ai(x: f64) -> f64 Ai(x): special::ai.
use special::notation::Ai;
assert((Ai(0.0) - 0.3550280538878172).abs() < 1e-16);
AiSource
pub fn Ai′(x: f64) -> f64 Ai′(x): special::aip.
use special::notation::Ai′;
assert((Ai′(0.0) + 0.2588194037928068).abs() < 1e-16);
BiSource
pub fn Bi(x: f64) -> f64 Bi(x): special::bi.
use special::notation::Bi;
assert(Bi(1.0) > 1.2);
BiSource
pub fn Bi′(x: f64) -> f64 Bi′(x): special::bip.
use special::notation::Bi′;
assert((Bi′(0.0) - 0.4482883573538264).abs() < 1e-16);
ζSource
pub fn ζ(s: f64) -> f64 ζ(s): the Riemann zeta function, special::zeta.
use special::notation::ζ;
assert((ζ(2.0) - 1.6449340668482264).abs() < 1e-15);
E₁Source
pub fn E₁(x: f64) -> f64 E₁(x): the exponential integral, special::e1.
use special::notation::E₁;
assert((E₁(1.0) - 0.21938393439552029).abs() < 1e-16);
EiSource
pub fn Ei(x: f64) -> f64 Ei(x): special::ei.
use special::notation::Ei;
assert((Ei(1.0) - 1.8951178163559368).abs() < 1e-15);
SiSource
pub fn Si(x: f64) -> f64 Si(x): the sine integral, special::si.
use special::notation::Si;
assert(Si(0.0) == 0.0);
CiSource
pub fn Ci(x: f64) -> f64 Ci(x): the cosine integral, special::ci.
use special::notation::Ci;
assert((Ci(1.0) - 0.3374039229009681).abs() < 1e-15);
W₀Source
pub fn W₀(x: f64) -> f64 W₀(x): the principal branch of the Lambert W function,
special::lambertw(x).
use special::notation::W₀;
assert((W₀(1.0) - 0.5671432904097838).abs() < 1e-16);
WSource
pub fn W₋₁(x: f64) -> f64 W₋₁(x): the lower branch of the Lambert W function,
special::lambertw(x, -1).
use special::notation::W₋₁;
let w = W₋₁(-0.1);
assert((w * w.exp() + 0.1).abs() < 1e-16);