Skip to content
module

special

40 members
lucid.special

lucid.special — special mathematical functions.

This sub-package adds functions that complement the elementary math already available at the top level (erf / sinc / lgamma / digamma / i0 / log1p / logit / xlogy / erfc / erfinv / expm1 …). Per H8 there is exactly one canonical path per op — those stay accessible only at the top level, and the extra entries below stay accessible only via lucid.special.<name>.

Implemented (all pure-Python composites over engine ops — no C++ work):

  • erfcx — scaled complementary error: exp(x²) · erfc(x)
  • i0e — exponentially-scaled Bessel I₀: exp(-|x|) · i0(x)
  • i1 — modified Bessel of order 1
  • i1e — exponentially-scaled i1
  • ndtr — normal CDF Φ(x) = ½·(1 + erf(x/√2))
  • ndtri — inverse normal CDF (Beasley-Springer-Moro)
  • log_ndtr — numerically-stable log(Φ(x))
  • xlog1py — x · log1p(y), taken as 0 wherever x = 0
  • entr — entropy element -x · log(x), 0 at x=0
  • multigammaln — log of the multivariate gamma function
  • polygamma — derivatives of digamma, any order n, on the whole real line (reflection for x < 0)
  • spherical_bessel_j0 — sin(x)/x with continuous extension at 0

Also: the order-0/1 Bessel family (bessel_j0/j1/y0/y1, modified_bessel_k0/k1 and their scaled forms — float32 by Abramowitz & Stegun polynomials, float64 by the Cephes double-precision series), the Hurwitz zeta, the regularized incomplete gamma gammainc / gammaincc and the orthogonal polynomials. Deferred (would need arbitrary-order Bessel machinery): iv, ive, Jacobi.

Functions

fngammainc→ Tensor

Regularized lower incomplete gamma function P(a,x)P(a, x).

fngammaincc→ Tensor

Regularized upper incomplete gamma function Q(a,x)Q(a, x).

fnzeta→ Tensor

Hurwitz zeta function ζ(x,q)\zeta(x, q).

fnchebyshev_polynomial_t→ Tensor

Chebyshev polynomial of the first kind, Tn(x)T_n(x).

fnchebyshev_polynomial_u→ Tensor

Chebyshev polynomial of the second kind, Un(x)U_n(x).

fnchebyshev_polynomial_v→ Tensor

Chebyshev polynomial of the third kind, Vn(x)V_n(x).

fnchebyshev_polynomial_w→ Tensor

Chebyshev polynomial of the fourth kind, Wn(x)W_n(x).

fnshifted_chebyshev_polynomial_t→ Tensor

Shifted Chebyshev T polynomial Tn∗(x)T^*_n(x) on [0,1][0, 1].

fnshifted_chebyshev_polynomial_u→ Tensor

Shifted Chebyshev U polynomial Un∗(x)U^*_n(x) on [0,1][0, 1].

fnshifted_chebyshev_polynomial_v→ Tensor

Shifted Chebyshev V polynomial Vn∗(x)V^*_n(x) on [0,1][0, 1].

fnshifted_chebyshev_polynomial_w→ Tensor

Shifted Chebyshev W polynomial Wn∗(x)W^*_n(x) on [0,1][0, 1].

fnhermite_polynomial_h→ Tensor

Physicist's Hermite polynomial Hn(x)H_n(x).

fnhermite_polynomial_he→ Tensor

Probabilist's Hermite polynomial Hen(x)\mathit{He}_n(x).

fnlegendre_polynomial_p→ Tensor

Legendre polynomial Pn(x)P_n(x).

fnlaguerre_polynomial_l→ Tensor

Laguerre polynomial Ln(x)L_n(x).

fnerfcx→ Tensor

Scaled complementary error function.

fni0e→ Tensor

Exponentially scaled modified Bessel function of order 0.

fni1→ Tensor

Modified Bessel function of the first kind, order 1.

fni1e→ Tensor

Exponentially scaled modified Bessel function of order 1.

fnndtr→ Tensor

Standard normal cumulative distribution function.

fnlog_ndtr→ Tensor

Numerically stable logarithm of the standard normal CDF.

fnndtri→ Tensor

Inverse standard normal CDF (probit / quantile function).

fnxlog1py→ Tensor

Safe product xlog⁡(1+y)x \log(1 + y) with limit-convention zero handling.

fnentr→ Tensor

Element-wise entropy kernel −xlog⁡x-x \log x.

fnmultigammaln→ Tensor

Logarithm of the multivariate gamma function Γp(a)\Gamma_p(a).

fnpolygamma→ Tensor

Polygamma function ψ(n)(x)\psi^{(n)}(x).

fnspherical_bessel_j0→ Tensor

Spherical Bessel function of the first kind, order 0.

fnbessel_j0→ Tensor

Bessel function of the first kind, order 0.

fnbessel_j1→ Tensor

Bessel function of the first kind, order 1.

fnbessel_y0→ Tensor

Bessel function of the second kind, order 0.

fnbessel_y1→ Tensor

Bessel function of the second kind, order 1.

fnmodified_bessel_k0→ Tensor

Modified Bessel function of the second kind, order 0.

fnscaled_modified_bessel_k0→ Tensor

Exponentially scaled modified Bessel K0K_0: exK0(x)e^x K_0(x).

fnmodified_bessel_k1→ Tensor

Modified Bessel function of the second kind, order 1.

fnscaled_modified_bessel_k1→ Tensor

Exponentially scaled modified Bessel K1K_1: exK1(x)e^x K_1(x).

fngammaln→ Tensor

Natural logarithm of the absolute value of the gamma function.

fnpsi→ Tensor

Digamma function ψ(x)=ddxlog⁡Γ(x)\psi(x) = \frac{d}{dx} \log \Gamma(x).

fnexpit→ Tensor

Logistic sigmoid (expit) function σ(x)\sigma(x).

fnmodified_bessel_i0→ Tensor

Modified Bessel function of the first kind, order 0.

fnmodified_bessel_i1→ Tensor

Modified Bessel function of the first kind, order 1.