Shunyaya Symbolic Mathematics — Special functions II — erf, Bessel, polylog, Lambert W (2.42)

Abstract
We survey four families—erf/erfc, Bessel (J, Y, I, K), polylogarithm Li_s, and Lambert W—and lift them to symbolic numerals (m, a) as magnitude maps with alignment carry on clearly stated domains/branches. We give guards, monotonicity/asymptotics, and numerics (log/exp tricks, scaling). Under collapse phi(m,a) = m, all formulas reduce to the classical ones.


General lift policy (unary unless noted)

For input x = (m, a) and a classical real-valued function f:

f*(m, a) = ( f(m) , a )         # alignment carry

  • Branches/parameters (e.g., order nu for Bessel, index s for polylog) are classical constants by default and thus tagged (constant, +1) unless you explicitly declare them symbolic.
  • Collapse check: phi( f*(m,a) ) = f(m) wherever f is defined on the chosen branch.

Manifest fields used below: branch = <...>, domain_guard = "error" | "clamp" | "nan", precision_targets, scaling.


Error function: erf, erfc

Definitions (classical).

erf(m)  = (2/sqrt(pi)) * ∫_0^m exp(-t^2) dt          for m in R
erfc(m) = 1 - erf(m)

Lift.

erf*(m, a)  = ( erf(m)  , a )
erfc*(m, a) = ( erfc(m) , a )

Monotonicity & range.
erf is strictly increasing, erf(R) = (-1, +1). erfc is strictly decreasing, in (0, 2).
Asymptotics.

erf(m)  ~ 1 - exp(-m^2)/(sqrt(pi)*m)      as m -> +inf
erfc(m) ~ exp(-m^2)/(sqrt(pi)*m)          as m -> +inf

Numerics.
Use series for small |m|, rational/continued-fraction or erfc for large |m|. Prefer expm1/log1p near zero when forming combinations.

Worked examples.

erf*((0, 0.4))   = ( 0 , 0.4 )
erf*((1, 0.7))   ≈ ( 0.8427 , 0.7 )
erfc*((2, -0.2)) ≈ ( 0.0047 , -0.2 )


Bessel functions: J_nu, Y_nu, I_nu, K_nu (survey)

Treat nu (order) as a classical parameter unless declared otherwise.

Domains (real line, principal).

J_nu(m), I_nu(m):   defined for m >= 0
Y_nu(m):            defined for m > 0 (singular at m = 0)
K_nu(m):            defined for m > 0 (modified Bessel of second kind)

Lifts (unary in m).

J_nu*(m, a) = ( J_nu(m) , a )
Y_nu*(m, a) = ( Y_nu(m) , a )           # domain guard at m=0
I_nu*(m, a) = ( I_nu(m) , a )
K_nu*(m, a) = ( K_nu(m) , a )           # domain guard at m=0

Qualitative behavior (fixed nu).

  • J_nu: oscillatory, ~ sqrt(2/(pi m)) * cos(m - nu*pi/2 - pi/4) for large m.
  • Y_nu: oscillatory with phase shift; singular as m -> 0+.
  • I_nu: monotone increasing for m > 0, ~ exp(m)/sqrt(2*pi m) for large m.
  • K_nu: decays for large m, ~ sqrt(pi/(2 m)) * exp(-m); singular as m -> 0+ for nu != 0.

Numerics (guards).

  • Use scaled forms for large |m|: e.g., I_nu(m) * exp(-|m|), K_nu(m) * exp(+|m|).
  • Three-term recurrences (up/down in nu) stabilize evaluation; choose direction per conditioning.
  • Near m = 0, switch to series or asymptotics and enforce domain_guard = "error" for Y_nu, K_nu if m <= 0.

Worked examples.

J_0*((0, 0.6))     = ( 1 , 0.6 )
J_1*((0, -0.4))    = ( 0 , -0.4 )
I_0*((3, 0.2))     ≈ ( 4.8808 , 0.2 )    # scaled evaluation recommended
K_0*((3, 0.2))     ≈ ( 0.034 , 0.2 )


Polylogarithm: Li_s(z) (real survey)

We present a real-line slice. Treat s as a classical parameter, use the principal branch in z.

Key cases (real z).

Li_s(z) = sum_{n=1}^inf z^n / n^s              for |z| < 1
Li_1(z) = -log(1 - z)                          for z < 1
Li_s(1) = zeta(s)                               for s > 1

Lift (unary in z).

Li_s*((z, a)) = ( Li_s(z) , a )

Domains/branches (principal real).

  • Safe series for |z| < 1.
  • At z = 1, use special values depending on s.
  • For z > 1 or z <= 0, analytic continuation introduces branch cuts; default domain_guard = "error" unless explicitly enabled.

Numerics.

  • Use acceleration near z ~ 1- (e.g., Euler transform) or identities (Li_1(z) = -log1p(-z)).
  • For s=2 (dilog), combine with known constants for checks.

Worked examples.

Li_1*((1/2, 0.5))   = ( -log(1 - 1/2) , 0.5 ) = ( log 2 , 0.5 ) ≈ ( 0.6931 , 0.5 )
Li_2*((1/2, 0.3))   ≈ ( 0.58224 , 0.3 )       # known value for validation


Lambert W: product logarithm W(x) (principal real branches)

Definition.

W(x) * exp( W(x) ) = x

Real branches and domains.

W_0(x):   principal branch,    defined for x >= -1/e,  increasing
W_-1(x):  lower branch,        defined for -1/e <= x < 0, decreasing

Lift.

W_0*((m, a))  = ( W_0(m)  , a )      with m >= -1/e
W_-1*((m, a)) = ( W_-1(m) , a )      with -1/e <= m < 0

Special values & asymptotics.

W_0(0) = 0,          W_0(-1/e) = -1
W_-1(-1/e) = -1,     W_-1(0-) -> -inf
W_0(x) ~ x - x^2 + (3/2)x^3  for |x| small
W_0(x) ~ log x - log log x   for x -> +inf

Guards (manifest).

lambertW.branch      = "W0" (default) | "W-1"
lambertW.domain_guard= "error" (default) | "clamp_to_-1/e" (for visualization only)

Worked examples.

W_0*((0, 0.9))     = ( 0 , 0.9 )
W_0*((1, 0.2))     ≈ ( 0.5671 , 0.2 )
W_-1*((-0.1, 0.4)) ≈ ( -2.278 , 0.4 )     # valid since -1/e ≈ -0.3679 < -0.1 < 0


Ordering, collapse, and composition

  • Order (magnitude channel). Where a function is monotone on its real domain (e.g., erf, I_nu for m>0, W_0 on [-1/e, +inf)), the lift preserves or reverses order accordingly (see 2.38).
  • Collapse: For any of the lifts above, phi( f*(m,a) ) = f(m) on the stated domain/branch.
  • Composition: Composition with other lifted maps obeys (g ∘ f)*(m,a) = ( g(f(m)) , a ) as usual, provided domains/branches match.

Implementation notes (manifest)

# Common
alignment_policy = "carry"                  # unary lifts
domain_guard     = "error"                  # default across families
precision_targets = { abs_tol: 1e-12, rel_tol: 1e-12 }

# erf/erfc
erf.strategy  = "series_small | erfc_large | continued_fraction"
use_expm1     = true

# Bessel
bessel.nu              = <value>    # classical unless declared symbolic
bessel.scaling         = "scaled_IK"          # to avoid overflow/underflow
bessel.recurrence_mode = "up" | "down"        # pick by conditioning
bessel.zero_guard      = "error" for Y_nu, K_nu when m <= 0

# Polylog
polylog.s              = <value>    # classical
polylog.branch         = "principal_real"
polylog.domain         = "|z|<1 plus special points"   # error otherwise
polylog.acceleration   = "euler | richardson | none"

# Lambert W
lambertW.branch        = "W0" | "W-1"
lambertW.domain_guard  = "error"


Takeaway

Each family lifts as-is on the magnitude channel while the alignment channel is carried—yielding collapse-safe definitions that interoperate with classical numerics. Clear domain/branch guards, asymptotic guidance, and stable evaluation strategies make these special functions reliable within SSM; when a = +1, you recover the standard functions exactly.


Navigation
Previous → Special functions I — gamma & beta (2.41)
Next → Logistic/sigmoid, softplus, softsign (2.43)


Disclaimer
Observation only. Results reproduce mathematically; domain claims require independent peer review. Defaults: mult_mode = M2, clamp_eps = 1e-6, |a| < 1. All formulas are presented in plain text. Collapse uses phi(m,a) = m.