Class SpecialFunctions

java.lang.Object
org.episteme.core.mathematics.analysis.special.SpecialFunctions

public class SpecialFunctions extends Object
Special mathematical functions.

Gamma, Beta, Bessel, Error functions - essential for physics, statistics, engineering.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Real
    Airy function Ai(x).
    static Real
    besselIn(int n, Real x)
    Modified Bessel function of the first kind I_n(x).
    static Real
    Bessel function of the first kind Jâ‚€(x).
    static Real
    besselJn(int n, Real x)
    Bessel function of the first kind J_n(x) for integer order.
    static Real
    besselKn(int n, Real x)
    Modified Bessel function of the second kind K_n(x).
    static Real
    Bessel function of the second kind Yâ‚€(x).
    static Real
    besselYn(int n, Real x)
    Bessel function of the second kind Y_n(x) for integer order.
    static Real
    beta(Real x, Real y)
    Beta function: B(x, y) = Γ(x)Γ(y) / Γ(x+y)
    static Real
    erf(Real x)
    Error function: erf(x) = (2/√π) ∫₀ˣ e^(-t²) dt
    static Real
    Complementary error function: erfc(x) = 1 - erf(x)
    static Real
    Factorial function: n!
    static Real
    Gamma function Γ(x) - generalization of factorial to real numbers.
    static Real
    hermite(int n, Real x)
    Hermite polynomial H_n(x) evaluated at x (physicist's convention).
    static Real
    Incomplete beta function: I_x(a, b).
    static Real
    Incomplete gamma function: γ(a, x) = ∫₀ˣ t^(a-1) e^(-t) dt
    static Real
    laguerre(int n, Real x)
    Laguerre polynomial L_n(x) evaluated at x.
    static Real
    legendre(int n, Real x)
    Legendre polynomial P_n(x) evaluated at x.
    static Real
    Natural logarithm of Gamma function: ln(Γ(x))

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpecialFunctions

      public SpecialFunctions()
  • Method Details

    • gamma

      public static Real gamma(Real x)
      Gamma function Γ(x) - generalization of factorial to real numbers.

      Γ(n) = (n-1)! for positive integers Uses Lanczos approximation for accuracy.

    • logGamma

      public static Real logGamma(Real x)
      Natural logarithm of Gamma function: ln(Γ(x))

      More numerically stable than Γ(x) for large x.

    • beta

      public static Real beta(Real x, Real y)
      Beta function: B(x, y) = Γ(x)Γ(y) / Γ(x+y)

      Used in probability distributions (Beta, Dirichlet).

    • erf

      public static Real erf(Real x)
      Error function: erf(x) = (2/√π) ∫₀ˣ e^(-t²) dt

      Probability: P(X ≤ x) for normal distribution = ½[1 + erf(x/√2)] Uses Abramowitz invalid input: '&' Stegun approximation.

    • erfc

      public static Real erfc(Real x)
      Complementary error function: erfc(x) = 1 - erf(x)
    • besselJ0

      public static Real besselJ0(Real x)
      Bessel function of the first kind Jâ‚€(x).

      Solutions to Bessel's differential equation. Used in physics: wave propagation, heat conduction, vibrations.

    • besselY0

      public static Real besselY0(Real x)
      Bessel function of the second kind Yâ‚€(x).
    • factorial

      public static Real factorial(Real n)
      Factorial function: n!

      For non-integers, uses Γ(n+1).

    • legendre

      public static Real legendre(int n, Real x)
      Legendre polynomial P_n(x) evaluated at x.

      Uses recurrence relation: P_0(x) = 1, P_1(x) = x, P_{n+1}(x) = ((2n+1)xP_n(x) - nP_{n-1}(x))/(n+1)

      Parameters:
      n - degree of the polynomial (n >= 0)
      x - point at which to evaluate
      Returns:
      P_n(x)
    • hermite

      public static Real hermite(int n, Real x)
      Hermite polynomial H_n(x) evaluated at x (physicist's convention).

      Uses recurrence relation: H_0(x) = 1, H_1(x) = 2x, H_{n+1}(x) = 2xH_n(x) - 2nH_{n-1}(x)

      Parameters:
      n - degree of the polynomial (n >= 0)
      x - point at which to evaluate
      Returns:
      H_n(x)
    • laguerre

      public static Real laguerre(int n, Real x)
      Laguerre polynomial L_n(x) evaluated at x.

      Uses recurrence relation: L_0(x) = 1, L_1(x) = 1-x, L_{n+1}(x) = ((2n+1-x)L_n(x) - nL_{n-1}(x))/(n+1)

      Parameters:
      n - degree of the polynomial (n >= 0)
      x - point at which to evaluate
      Returns:
      L_n(x)
    • incompleteGamma

      public static Real incompleteGamma(Real a, Real x)
      Incomplete gamma function: γ(a, x) = ∫₀ˣ t^(a-1) e^(-t) dt

      Regularized: P(a, x) = γ(a, x) / Γ(a)

      Parameters:
      a - Shape parameter (a > 0)
      x - Upper limit (x >= 0)
      Returns:
      Regularized incomplete gamma P(a, x)
    • incompleteBeta

      public static Real incompleteBeta(Real x, Real a, Real b)
      Incomplete beta function: I_x(a, b).

      Regularized: I_x(a, b) = B(x; a,b) / B(a,b) Used in statistics: CDF of Beta distribution.

      Parameters:
      x - Value (0 invalid input: '<'= x invalid input: '<'= 1)
      a - First parameter (a > 0)
      b - Second parameter (b > 0)
      Returns:
      Regularized incomplete beta I_x(a, b)
    • airyAi

      public static Real airyAi(Real x)
      Airy function Ai(x).

      Solution to y'' - xy = 0 that decays as x → ∞. Used in quantum mechanics (wave functions near turning points).

    • besselJn

      public static Real besselJn(int n, Real x)
      Bessel function of the first kind J_n(x) for integer order.
      Parameters:
      n - Order (integer)
      x - Argument
      Returns:
      J_n(x)
    • besselYn

      public static Real besselYn(int n, Real x)
      Bessel function of the second kind Y_n(x) for integer order.
      Parameters:
      n - Order (integer, n >= 0)
      x - Argument (x > 0)
      Returns:
      Y_n(x)
    • besselIn

      public static Real besselIn(int n, Real x)
      Modified Bessel function of the first kind I_n(x).

      I_n(x) = i^(-n) * J_n(ix)

      Parameters:
      n - Order (integer)
      x - Argument
      Returns:
      I_n(x)
    • besselKn

      public static Real besselKn(int n, Real x)
      Modified Bessel function of the second kind K_n(x).

      Decays exponentially for large x, diverges at x=0.

      Parameters:
      n - Order (integer, n >= 0)
      x - Argument (x > 0)
      Returns:
      K_n(x)