JavaScript / TypeScript API

nerdamer/special

Gamma, error, exponential, logarithmic, sine, and cosine special functions.

Direct npm import. The items on this page are JavaScript / TypeScript exports from nerdamer/special. For functions used inside nerdamer('...'), see Nerdamer Notation.
12 exports

Functions

Chi(x: Expression): ExpressionFunction

Computes the hyperbolic cosine integral: Chi(x) = γ + ln(x) + ∫₀ˣ (cosh(t)−1)/t dt, where γ is the Euler–Mascheroni constant. - Chi(±∞) = +∞ - Chi(0) = −∞ - The function is even for the principal branch: Chi(-x) = Chi(x).

Ci(x: Expression): ExpressionFunction

Computes the cosine integral: Ci(x) = γ + ln(x) + ∫₀ˣ (cos(t)−1)/t dt, where γ is the Euler–Mascheroni constant. - Ci(+∞) = 0, Ci(−∞) = 0 - Ci(0) = −∞ - Negative real arguments take the upper side of the principal logarithm branch.

Ei(x: Expression): ExpressionFunction

Computes the exponential integral: Ei(x) = −∫₋ₓ^∞ e^(−t)/t dt (Cauchy principal value). - Ei(+∞) = +∞, Ei(−∞) = 0 - Ei(0) = −∞

erf(x: Expression): ExpressionFunction

Computes the error function erf(x). - erf(+∞) = 1, erf(−∞) = −1 - For numeric inputs, returns a high-precision decimal approximation. - For symbolic inputs, returns an unevaluated erf(x) node.

erfc(x: Expression): ExpressionFunction

Computes the complementary error function: erfc(x) = 1 − erf(x).

gamma(x: Expression): ExpressionFunction

Computes the gamma function Γ(x). - For positive integers: Γ(n) = (n − 1)! - For half-integers (e.g. 1/2, 3/2, -3/2): returns a closed-form expression involving sqrt(π). - For other numeric values: uses a high-precision decimal approximation. - For symbolic inputs: returns an unevaluated gamma(x) node.

gammaIncomplete(a: ExpressionInput, z: ExpressionInput): ExpressionFunction

Upper incomplete gamma Γ(a, z). Positive integer first arguments are expanded exactly using the finite-sum formula. Other inputs remain symbolic.

gammaIncompleteLower(a: ExpressionInput, z: ExpressionInput): ExpressionFunction

Lower incomplete gamma γ(a, z). Positive integer first arguments use γ(a,z) = Γ(a) - Γ(a,z). Other inputs remain symbolic.

Li(x: Expression): ExpressionFunction

Computes the logarithmic integral: Li(x) = ∫₀ˣ 1/ln(t) dt. - Li(+∞) = +∞ - Li(1) = −∞ (the function has a logarithmic singularity at 1) - For negative numeric inputs, returns the symbolic form.

Shi(x: Expression): ExpressionFunction

Computes the hyperbolic sine integral: Shi(x) = ∫₀ˣ sinh(t)/t dt. - Shi(+∞) = +∞, Shi(−∞) = −∞ - Shi(0) = 0 - The function is odd: Shi(-x) = -Shi(x).

Si(x: Expression): ExpressionFunction

Computes the sine integral: Si(x) = ∫₀ˣ sin(t)/t dt. - Si(+∞) = π/2, Si(−∞) = −π/2 - Si(0) = 0 - The function is odd: Si(-x) = -Si(x).

sinc(x: Expression): ExpressionFunction

Computes the normalized sinc function: sinc(x) = sin(x) / x. By convention, sinc(0) = 1 (the removable singularity). The function is even: sinc(-x) = sinc(x).