special

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package special implements special mathematical functions in pure Go.

The package collects the classical higher transcendental functions that do not appear in the standard math package, grouped by family:

  • Bessel functions of the first and second kind (J0, J1, Jn, Y0, Y1, Yn), the modified Bessel functions (I0, I1, In, K0, K1, Kn), the spherical Bessel functions (SphericalJn, SphericalYn) and the Struve functions (StruveH0, StruveH1).
  • Airy functions Ai, Bi and their derivatives.
  • Elliptic integrals and related quantities.
  • The error function family, including the Fresnel integrals.
  • The exponential, sine and cosine integrals.
  • The Riemann zeta family (zeta, eta, beta).
  • The Lambert W function.
  • The gamma family (log-gamma, digamma, incomplete forms).

Every routine is implemented with the Go standard library only, using series expansions for small arguments and asymptotic expansions for large ones so that results remain accurate across the full real line. The functions are deterministic and aim for correctness first: they are validated in the test suite against known closed-form and reference values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Airy

func Airy(x float64) (ai, aip, bi, bip float64)

Airy returns the Airy functions Ai(x), Ai'(x), Bi(x) and Bi'(x) simultaneously. The implementation expresses the Airy functions in terms of modified Bessel functions (for x > 0) and ordinary Bessel functions (for x < 0), with a Maclaurin evaluation near the origin.

func AiryAi

func AiryAi(x float64) float64

AiryAi returns the Airy function of the first kind, Ai(x).

func AiryAiPrime

func AiryAiPrime(x float64) float64

AiryAiPrime returns the derivative of the Airy function of the first kind, Ai'(x).

func AiryBi

func AiryBi(x float64) float64

AiryBi returns the Airy function of the second kind, Bi(x).

func AiryBiPrime

func AiryBiPrime(x float64) float64

AiryBiPrime returns the derivative of the Airy function of the second kind, Bi'(x).

func AiryZeroAi

func AiryZeroAi(s int) float64

AiryZeroAi returns an approximation to the s-th real zero (s >= 1) of the Airy function Ai, using the standard asymptotic expansion. The returned value is negative.

func AiryZeroBi

func AiryZeroBi(s int) float64

AiryZeroBi returns an approximation to the s-th real zero (s >= 1) of the Airy function Bi, using the standard asymptotic expansion. The returned value is negative.

func BesselI

func BesselI(n int, x float64) float64

BesselI returns the modified Bessel function of the first kind of integer order n, Iₙ(x).

func BesselI0

func BesselI0(x float64) float64

BesselI0 returns the modified Bessel function of the first kind of order zero, I0(x). The result is even in x and always ≥ 1.

func BesselI0Prime

func BesselI0Prime(x float64) float64

BesselI0Prime returns the derivative of I0, which equals I1(x).

func BesselI0e

func BesselI0e(x float64) float64

BesselI0e returns the exponentially scaled I0, namely e^{-|x|} I0(x).

func BesselI1

func BesselI1(x float64) float64

BesselI1 returns the modified Bessel function of the first kind of order one, I1(x). The result is odd in x.

func BesselI1Prime

func BesselI1Prime(x float64) float64

BesselI1Prime returns the derivative of I1(x).

func BesselI1e

func BesselI1e(x float64) float64

BesselI1e returns the exponentially scaled I1, namely e^{-|x|} I1(x).

func BesselIn

func BesselIn(n int, x float64) float64

BesselIn returns the modified Bessel function of the first kind of integer order n, In(x). Negative orders satisfy In(-n, x) = In(n, x).

func BesselInPrime

func BesselInPrime(n int, x float64) float64

BesselInPrime returns the derivative of the modified Bessel function In(x).

func BesselIne

func BesselIne(n int, x float64) float64

BesselIne returns the exponentially scaled In, namely e^{-|x|} In(x).

func BesselInu

func BesselInu(nu, x float64) float64

BesselInu returns the modified Bessel function of the first kind of arbitrary real order nu, I_nu(x), for x >= 0. It sums the convergent ascending power series and is accurate for small to moderate arguments.

func BesselJ

func BesselJ(n int, x float64) float64

BesselJ returns the Bessel function of the first kind of integer order n, Jₙ(x).

func BesselJ0

func BesselJ0(x float64) float64

BesselJ0 returns the Bessel function of the first kind of order zero, J0(x).

func BesselJ0Prime

func BesselJ0Prime(x float64) float64

BesselJ0Prime returns the derivative of J0, which equals -J1(x).

func BesselJ1

func BesselJ1(x float64) float64

BesselJ1 returns the Bessel function of the first kind of order one, J1(x).

func BesselJ1Prime

func BesselJ1Prime(x float64) float64

BesselJ1Prime returns the derivative of J1(x).

func BesselJZero

func BesselJZero(n, s int) float64

BesselJZero returns an approximation to the s-th positive zero (s >= 1) of the Bessel function J_n, using McMahon's asymptotic expansion. Accuracy improves rapidly with s.

func BesselJn

func BesselJn(n int, x float64) float64

BesselJn returns the Bessel function of the first kind of integer order n, Jn(x). It is valid for any integer n (negative orders use the reflection Jn(-n, x) = (-1)^n Jn(n, x)).

func BesselJnPrime

func BesselJnPrime(n int, x float64) float64

BesselJnPrime returns the derivative of the Bessel function Jn(x).

func BesselJnu

func BesselJnu(nu, x float64) float64

BesselJnu returns the Bessel function of the first kind of arbitrary real order nu, J_nu(x), for x >= 0. It sums the convergent ascending power series and is accurate for small to moderate arguments.

func BesselK

func BesselK(n int, x float64) float64

BesselK returns the modified Bessel function of the second kind of integer order n, Kₙ(x), for x > 0.

func BesselK0

func BesselK0(x float64) float64

BesselK0 returns the modified Bessel function of the second kind of order zero, K0(x). It is defined for x > 0.

func BesselK0Prime

func BesselK0Prime(x float64) float64

BesselK0Prime returns the derivative of K0, which equals -K1(x). Defined for x > 0.

func BesselK0e

func BesselK0e(x float64) float64

BesselK0e returns the exponentially scaled K0, namely e^{x} K0(x). Defined for x > 0.

func BesselK1

func BesselK1(x float64) float64

BesselK1 returns the modified Bessel function of the second kind of order one, K1(x). It is defined for x > 0.

func BesselK1Prime

func BesselK1Prime(x float64) float64

BesselK1Prime returns the derivative of K1(x). Defined for x > 0.

func BesselK1e

func BesselK1e(x float64) float64

BesselK1e returns the exponentially scaled K1, namely e^{x} K1(x). Defined for x > 0.

func BesselKn

func BesselKn(n int, x float64) float64

BesselKn returns the modified Bessel function of the second kind of integer order n, Kn(x). It is defined for x > 0. Negative orders satisfy Kn(-n, x) = Kn(n, x).

func BesselKnPrime

func BesselKnPrime(n int, x float64) float64

BesselKnPrime returns the derivative of the modified Bessel function Kn(x). Defined for x > 0.

func BesselKne

func BesselKne(n int, x float64) float64

BesselKne returns the exponentially scaled Kn, namely e^{x} Kn(x). Defined for x > 0.

func BesselWronskianIK

func BesselWronskianIK(x float64) float64

BesselWronskianIK returns the Wronskian I_n(x) K_n'(x) - I_n'(x) K_n(x), which equals -1/x for every order n. Defined for x > 0.

func BesselWronskianJY

func BesselWronskianJY(x float64) float64

BesselWronskianJY returns the Wronskian J_n(x) Y_n'(x) - J_n'(x) Y_n(x), which equals 2/(pi x) for every order n. Defined for x > 0.

func BesselY

func BesselY(n int, x float64) float64

BesselY returns the Bessel function of the second kind of integer order n, Yₙ(x), for x > 0.

func BesselY0

func BesselY0(x float64) float64

BesselY0 returns the Bessel function of the second kind of order zero, Y0(x). It is defined for x > 0.

func BesselY0Prime

func BesselY0Prime(x float64) float64

BesselY0Prime returns the derivative of Y0, which equals -Y1(x). Defined for x > 0.

func BesselY1

func BesselY1(x float64) float64

BesselY1 returns the Bessel function of the second kind of order one, Y1(x). It is defined for x > 0.

func BesselY1Prime

func BesselY1Prime(x float64) float64

BesselY1Prime returns the derivative of Y1(x). Defined for x > 0.

func BesselYZero

func BesselYZero(n, s int) float64

BesselYZero returns an approximation to the s-th positive zero (s >= 1) of the Bessel function Y_n, using McMahon's asymptotic expansion. Accuracy improves rapidly with s.

func BesselYn

func BesselYn(n int, x float64) float64

BesselYn returns the Bessel function of the second kind of integer order n, Yn(x). It is defined for x > 0.

func BesselYnPrime

func BesselYnPrime(n int, x float64) float64

BesselYnPrime returns the derivative of the Bessel function Yn(x). Defined for x > 0.

func Beta

func Beta(a, b float64) float64

Beta returns the beta function B(a, b) = Γ(a)Γ(b)/Γ(a+b) for a, b > 0.

func BetaInc

func BetaInc(a, b, x float64) float64

BetaInc returns the regularized incomplete beta function,

I_x(a, b) = (1/B(a,b)) ∫₀ˣ t^{a-1}(1-t)^{b-1} dt,

for 0 ≤ x ≤ 1 and a, b > 0.

func Chi

func Chi(x float64) float64

Chi returns the hyperbolic cosine integral,

Chi(x) = γ + ln x + ∫₀ˣ (cosh(t)-1)/t dt,   x > 0.

func Ci

func Ci(x float64) float64

Ci returns the cosine integral,

Ci(x) = γ + ln x + ∫₀ˣ (cos(t)-1)/t dt,   x > 0.

func Dawson

func Dawson(x float64) float64

Dawson returns Dawson's integral,

D(x) = e^{-x²} ∫₀ˣ e^{t²} dt.

The implementation uses a rational/series scheme accurate to near machine precision across the whole real line.

func Digamma

func Digamma(x float64) float64

Digamma returns the digamma function ψ(x) = Γ'(x)/Γ(x), the logarithmic derivative of the gamma function, for real x that is not a non-positive integer.

func DirichletBeta

func DirichletBeta(s float64) float64

DirichletBeta returns the Dirichlet beta function,

β(s) = Σ_{n≥0} (-1)^n (2n+1)^{-s}.

It satisfies β(1) = π/4 and β(2) = Catalan's constant.

func DirichletEta

func DirichletEta(s float64) float64

DirichletEta returns the Dirichlet eta function (alternating zeta),

η(s) = Σ_{n≥1} (-1)^{n-1} n^{-s} = (1 - 2^{1-s}) ζ(s).

func E1

func E1(x float64) float64

E1 returns the exponential integral E₁,

E₁(x) = ∫₁^∞ e^{-x t}/t dt = ∫_x^∞ e^{-t}/t dt,   x > 0.

For x ≤ 0 the value is defined via analytic continuation as -Ei(-x).

func Ei

func Ei(x float64) float64

Ei returns the exponential integral,

Ei(x) = -∫_{-x}^∞ e^{-t}/t dt   (principal value for x > 0).

It is defined for all real x ≠ 0; Ei(0) is -Inf.

func EllipticE

func EllipticE(m float64) float64

EllipticE returns the complete elliptic integral of the second kind,

E(m) = ∫₀^{π/2} √(1 - m sin²θ) dθ,

with parameter m = k². It is defined for m ≤ 1.

func EllipticEInc

func EllipticEInc(phi, m float64) float64

EllipticEInc returns the incomplete elliptic integral of the second kind,

E(φ, m) = ∫₀^φ √(1 - m sin²θ) dθ,

with amplitude φ (radians) and parameter m = k².

func EllipticF

func EllipticF(phi, m float64) float64

EllipticF returns the incomplete elliptic integral of the first kind,

F(φ, m) = ∫₀^φ dθ / √(1 - m sin²θ),

with amplitude φ (radians) and parameter m = k².

func EllipticK

func EllipticK(m float64) float64

EllipticK returns the complete elliptic integral of the first kind,

K(m) = ∫₀^{π/2} dθ / √(1 - m sin²θ),

with parameter m = k². It is defined for m < 1.

func EllipticPi

func EllipticPi(n, m float64) float64

EllipticPi returns the complete elliptic integral of the third kind,

Π(n, m) = ∫₀^{π/2} dθ / ((1 - n sin²θ)√(1 - m sin²θ)),

with characteristic n and parameter m = k².

func EllipticPiInc

func EllipticPiInc(n, phi, m float64) float64

EllipticPiInc returns the incomplete elliptic integral of the third kind,

Π(n; φ, m) = ∫₀^φ dθ / ((1 - n sin²θ)√(1 - m sin²θ)).

func En

func En(n int, x float64) float64

En returns the generalized exponential integral of order n,

Eₙ(x) = ∫₁^∞ e^{-x t}/tⁿ dt,   x ≥ 0, n ≥ 0.

E₀(x) = e^{-x}/x and E₁ coincides with the two-argument E1.

func Erf

func Erf(x float64) float64

Erf returns the error function of x,

erf(x) = (2/√π) ∫₀ˣ e^{-t²} dt.

It delegates to the standard library implementation.

func Erfc

func Erfc(x float64) float64

Erfc returns the complementary error function of x, erfc(x) = 1 - erf(x). It is accurate even when erf(x) is very close to 1.

func Erfcx

func Erfcx(x float64) float64

Erfcx returns the scaled complementary error function,

erfcx(x) = e^{x²} · erfc(x).

The scaling removes the exponential decay of erfc for large positive x, avoiding underflow.

func Erfi

func Erfi(x float64) float64

Erfi returns the imaginary error function,

erfi(x) = -i·erf(i·x) = (2/√π) ∫₀ˣ e^{t²} dt.

It grows super-exponentially and is related to Dawson's function by erfi(x) = (2/√π)·e^{x²}·D(x).

func Fresnel

func Fresnel(x float64) (s, c float64)

Fresnel returns both Fresnel integrals S(x) and C(x) simultaneously,

S(x) = ∫₀ˣ sin(π t²/2) dt,   C(x) = ∫₀ˣ cos(π t²/2) dt.

A power series is used for small |x| and an asymptotic auxiliary-function expansion for large |x|.

func FresnelC

func FresnelC(x float64) float64

FresnelC returns the Fresnel cosine integral,

C(x) = ∫₀ˣ cos(π t²/2) dt.

func FresnelS

func FresnelS(x float64) float64

FresnelS returns the Fresnel sine integral,

S(x) = ∫₀ˣ sin(π t²/2) dt.

func Gamma

func Gamma(x float64) float64

Gamma returns the gamma function Γ(x); it delegates to the standard library and is provided for API completeness alongside the incomplete forms.

func GammaP

func GammaP(a, x float64) float64

GammaP returns the regularized lower incomplete gamma function,

P(a, x) = (1/Γ(a)) ∫₀ˣ t^{a-1} e^{-t} dt,   a > 0, x ≥ 0.

func GammaQ

func GammaQ(a, x float64) float64

GammaQ returns the regularized upper incomplete gamma function,

Q(a, x) = 1 - P(a, x) = (1/Γ(a)) ∫ₓ^∞ t^{a-1} e^{-t} dt.

func HurwitzZeta

func HurwitzZeta(s, a float64) float64

HurwitzZeta returns the Hurwitz zeta function,

ζ(s, a) = Σ_{n≥0} (n + a)^{-s},   s > 1, a > 0,

extended to s < 1 (s ≠ 1) by Euler–Maclaurin summation.

func HypSinCosIntegral

func HypSinCosIntegral(x float64) (shi, chi float64)

HypSinCosIntegral returns the hyperbolic sine integral Shi(x) and hyperbolic cosine integral Chi(x) simultaneously. Shi is odd; Chi is evaluated at |x|.

func IncompleteBeta

func IncompleteBeta(a, b, x float64) float64

IncompleteBeta returns the (non-regularized) incomplete beta function B(x; a, b) = ∫₀ˣ t^{a-1}(1-t)^{b-1} dt = I_x(a, b)·B(a, b).

func InverseErf

func InverseErf(x float64) float64

InverseErf returns the inverse error function, the value y such that erf(y) = x for x in the open interval (-1, 1). It returns ±Inf at ±1 and NaN outside [-1, 1].

func InverseErfc

func InverseErfc(x float64) float64

InverseErfc returns the inverse complementary error function, the value y such that erfc(y) = x for x in the open interval (0, 2). It returns ±Inf at the endpoints and NaN outside [0, 2].

func KelvinBei

func KelvinBei(x float64) float64

KelvinBei returns the Kelvin function bei(x) = Im[J0(x e^{3iπ/4})], summed from its convergent power series.

func KelvinBer

func KelvinBer(x float64) float64

KelvinBer returns the Kelvin function ber(x) = Re[J0(x e^{3iπ/4})], summed from its convergent power series.

func KelvinKei

func KelvinKei(x float64) float64

KelvinKei returns the Kelvin function kei(x) for x > 0, summed from its series with the leading logarithmic terms. It uses

kei(x) = -(ln(x/2)+γ) bei(x) - (π/4) ber(x)
         + Σ_{k≥0} (-1)^k φ(2k+1) / ((2k+1)!)^2 (x/2)^{4k+2}

where φ(n) is the n-th harmonic number.

func KelvinKer

func KelvinKer(x float64) float64

KelvinKer returns the Kelvin function ker(x) for x > 0, summed from its series with the leading logarithmic terms. It uses

ker(x) = -(ln(x/2)+γ) ber(x) + (π/4) bei(x)
         + Σ_{k≥0} (-1)^k φ(2k) / ((2k)!)^2 (x/2)^{4k}

where φ(n) is the n-th harmonic number and φ(0) = 0.

func LambertW

func LambertW(x float64) float64

LambertW returns the principal branch W₀(x) of the Lambert W function, the solution w of w·e^w = x for x ≥ -1/e. It returns NaN for x < -1/e.

func LambertWm1

func LambertWm1(x float64) float64

LambertWm1 returns the secondary real branch W₋₁(x) of the Lambert W function for -1/e ≤ x < 0, the solution w ≤ -1 of w·e^w = x.

func Li

func Li(x float64) float64

Li returns the logarithmic integral,

li(x) = ∫₀ˣ dt/ln t   (principal value for x > 1),

which equals Ei(ln x). It is defined for x > 0, x ≠ 1.

func Li2

func Li2(x float64) float64

Li2 returns the dilogarithm,

Li₂(x) = Σ_{k≥1} x^k / k² = -∫₀ˣ ln(1-t)/t dt,

for real x ≤ 1. Analytic continuation handles x < -1 and 0 < x ≤ 1.

func Li3

func Li3(x float64) float64

Li3 returns the trilogarithm,

Li₃(x) = Σ_{k≥1} x^k / k³,

for real x with |x| ≤ 1 (and x < 1). Values outside are returned via the series where it converges.

func LogGamma

func LogGamma(x float64) float64

LogGamma returns the natural logarithm of the absolute value of the gamma function, ln|Γ(x)|.

func LowerIncompleteGamma

func LowerIncompleteGamma(a, x float64) float64

LowerIncompleteGamma returns the (non-regularized) lower incomplete gamma function γ(a, x) = ∫₀ˣ t^{a-1} e^{-t} dt = P(a, x)·Γ(a).

func ModifiedSphericalI0

func ModifiedSphericalI0(x float64) float64

ModifiedSphericalI0 returns the modified spherical Bessel function of the first kind of order zero, i0(x) = sinh(x)/x.

func ModifiedSphericalI1

func ModifiedSphericalI1(x float64) float64

ModifiedSphericalI1 returns the modified spherical Bessel function of the first kind of order one, i1(x) = (x cosh(x) - sinh(x)) / x^2.

func ModifiedSphericalK0

func ModifiedSphericalK0(x float64) float64

ModifiedSphericalK0 returns the modified spherical Bessel function of the second kind of order zero, k0(x) = (pi/2) e^{-x}/x. Defined for x > 0.

func ModifiedSphericalK1

func ModifiedSphericalK1(x float64) float64

ModifiedSphericalK1 returns the modified spherical Bessel function of the second kind of order one, k1(x) = (pi/2) e^{-x} (1 + 1/x) / x. Defined for x > 0.

func Polygamma

func Polygamma(n int, x float64) float64

Polygamma returns the polygamma function ψ⁽ⁿ⁾(x), the n-th derivative of the digamma function, for integer order n ≥ 0 and real x > 0.

ψ⁽ⁿ⁾(x) = (-1)^{n+1} n! Σ_{k≥0} (x+k)^{-(n+1)}   for n ≥ 1.

func Polylog

func Polylog(s int, x float64) float64

Polylog returns the polylogarithm Liₛ(x) = Σ_{k≥1} x^k / k^s for integer order s and real |x| < 1 (and x = 1 when s > 1, giving ζ(s)). It sums the defining series directly.

func ReciprocalGamma

func ReciprocalGamma(x float64) float64

ReciprocalGamma returns 1/Γ(x), which is entire and vanishes at the non-positive integers.

func RiccatiBesselChi

func RiccatiBesselChi(n int, x float64) float64

RiccatiBesselChi returns the Riccati-Bessel function chi_n(x) = -x yn(x).

func RiccatiBesselPsi

func RiccatiBesselPsi(n int, x float64) float64

RiccatiBesselPsi returns the Riccati-Bessel function psi_n(x) = x jn(x).

func Shi

func Shi(x float64) float64

Shi returns the hyperbolic sine integral,

Shi(x) = ∫₀ˣ sinh(t)/t dt.

func Si

func Si(x float64) float64

Si returns the sine integral,

Si(x) = ∫₀ˣ sin(t)/t dt.

func SinCosIntegral

func SinCosIntegral(x float64) (si, ci float64)

SinCosIntegral returns the sine integral Si(x) and cosine integral Ci(x) simultaneously. For x < 0, Si is odd (Si(-x) = -Si(x)) and Ci(x) is evaluated as Ci(|x|).

func Sinc

func Sinc(x float64) float64

Sinc returns the unnormalized cardinal sine, sinc(x) = sin(x)/x, with the removable singularity Sinc(0) = 1 handled exactly.

func SincNorm

func SincNorm(x float64) float64

SincNorm returns the normalized cardinal sine, sinc(x) = sin(πx)/(πx), with SincNorm(0) = 1.

func SphericalJ0

func SphericalJ0(x float64) float64

SphericalJ0 returns the spherical Bessel function of the first kind of order zero, j0(x) = sin(x)/x, with the removable singularity handled at x = 0.

func SphericalJ1

func SphericalJ1(x float64) float64

SphericalJ1 returns the spherical Bessel function of the first kind of order one, j1(x) = sin(x)/x^2 - cos(x)/x.

func SphericalJn

func SphericalJn(n int, x float64) float64

SphericalJn returns the spherical Bessel function of the first kind of order n, jn(x) = sqrt(pi/(2x)) J_{n+1/2}(x). It uses stable upward recurrence for x ≥ n and downward (Miller) recurrence otherwise.

func SphericalJnPrime

func SphericalJnPrime(n int, x float64) float64

SphericalJnPrime returns the derivative of the spherical Bessel function jn(x), using jn'(x) = j_{n-1}(x) - (n+1)/x * jn(x).

func SphericalY0

func SphericalY0(x float64) float64

SphericalY0 returns the spherical Bessel function of the second kind of order zero, y0(x) = -cos(x)/x. It is defined for x > 0.

func SphericalY1

func SphericalY1(x float64) float64

SphericalY1 returns the spherical Bessel function of the second kind of order one, y1(x) = -cos(x)/x^2 - sin(x)/x. It is defined for x > 0.

func SphericalYn

func SphericalYn(n int, x float64) float64

SphericalYn returns the spherical Bessel function of the second kind of order n, yn(x). It is defined for x > 0 and uses stable upward recurrence.

func SphericalYnPrime

func SphericalYnPrime(n int, x float64) float64

SphericalYnPrime returns the derivative of the spherical Bessel function yn(x), using yn'(x) = y_{n-1}(x) - (n+1)/x * yn(x). Defined for x > 0.

func Struve

func Struve(n int, x float64) float64

Struve returns the Struve function Hₙ(x) of integer order n by its power series,

Hₙ(x) = Σ_{m≥0} (-1)^m /(Γ(m+3/2) Γ(m+n+3/2)) (x/2)^{2m+n+1}.

func StruveH0

func StruveH0(x float64) float64

StruveH0 returns the Struve function of order zero, H0(x). It is odd in x and uses a power series for small |x| and the relation to Y0 for large |x|.

func StruveH1

func StruveH1(x float64) float64

StruveH1 returns the Struve function of order one, H1(x). It is even in x and uses a power series for small |x| and the relation to Y1 for large |x|.

func StruveL0

func StruveL0(x float64) float64

StruveL0 returns the modified Struve function of order zero, L0(x). It is odd in x and uses the all-positive-term power series for moderate |x|.

func StruveL1

func StruveL1(x float64) float64

StruveL1 returns the modified Struve function of order one, L1(x). It is even in x and uses the all-positive-term power series for moderate |x|.

func Trigamma

func Trigamma(x float64) float64

Trigamma returns the trigamma function ψ⁽¹⁾(x), the first derivative of the digamma function, for real x that is not a non-positive integer.

func UpperIncompleteGamma

func UpperIncompleteGamma(a, x float64) float64

UpperIncompleteGamma returns the (non-regularized) upper incomplete gamma function Γ(a, x) = ∫ₓ^∞ t^{a-1} e^{-t} dt = Q(a, x)·Γ(a).

func Zeta

func Zeta(s float64) float64

Zeta returns the Riemann zeta function ζ(s) for real s ≠ 1.

ζ(s) = Σ_{n≥1} n^{-s}   (for s > 1, extended by analytic continuation).

The reflection formula is used for s < 0.5.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL