Special Functions API
All functions return numeric results (or {re, im} tables for complex results). Errors surface as Lua errors when inputs fall outside supported domains.
Digamma
Section titled “Digamma”Logarithmic derivative of the Gamma function,
local psi = sim.digamma(1.5)local psi_c = sim.digamma({1.0, 0.2})Trigamma
Section titled “Trigamma”First polygamma (derivative of digamma),
local trig = sim.trigamma(2.0)local trig_c = sim.trigamma({0.5, -0.3})Hyperexponential
Section titled “Hyperexponential”-- High precision evaluation of hyperexponential sumlocal val = sim.hyperexp(2.0, 0.5, 8)
-- Digamma backed evaluation for stability at large Klocal phi = sim.hyperexp_phi(2.0, 0.5, 8)
-- Complex extensionlocal phi_c = sim.hyperexp_phi_complex({1.2, 0.3}, {0.8, -0.1}, 8)
-- Derivative of phi with respect to lambdalocal dphi = sim.hyperexp_phi_deriv(1.5, 0.4, 6)q-Deformed Hyperexponential
Section titled “q-Deformed Hyperexponential”local qh = sim.qhyperexp(1.5, 0.2, 12, 0.9)
-- Alias of `sim.qhyperexp`; evaluates the same $\phi_q$ for real arguments.local qphi = sim.qhyperexp_phi(1.5, 0.2, 12, 0.9)
-- Complex extensionlocal qphi_c = sim.qhyperexp_phi_complex({0.6, 0.4}, {0.3, -0.2}, 12, 0.9)
-- Derivative of $\phi_q$ with respect to $\lambda$local qphi_d = sim.qhyperexp_phi_deriv(1.5, 0.2, 12, 0.9)
-- Complex derivativelocal qphi_dc = sim.qhyperexp_phi_deriv_complex({0.6, 0.4}, {0.3, -0.2}, 12, 0.9)Jackson q-Number
Section titled “Jackson q-Number”with limit as .
local qn = sim.qnumber(1.5, 0.8)local qn_c = sim.qnumber({0.5, 0.2}, 0.8)q-Deformed Hurwitz Zeta
Section titled “q-Deformed Hurwitz Zeta”convergent for , , .
local z = sim.qzeta(1.5, 0.5, 0.9)q-Digamma Series
Section titled “q-Digamma Series”falling back to the classical as .
local qpsi = sim.qdigamma(1.25, 0.9)local qpsi_c = sim.qdigamma({1.0, -0.25}, 0.9)