Skip to content

Equation operators

Generated by sema doc from the compiler’s authoritative native-signature registry.

Differential operators available inside equation: blocks (LANGUAGE §5.28) — not math. members.

Unicode equation alias of pi.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float
  • example: π

Unicode equation alias of e.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float
  • example: ℯ

Unicode equation alias of tau.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float
  • example: τ

Finite complex unit i.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float | complex
  • example: imaginary_unit

Unicode equation alias of imaginary_unit.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float | complex
  • example: ⅈ

Named equation alias of positive infinity.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float
  • example: infinity

Mathematical positive-infinity literal.

  • domain: immutable equation-scope constant; not callable
  • shape: scalar
  • returns: float
  • example: ∞

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: exp(1.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: expm1(0.25)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: log(e)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: ln(e)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: log1p(0.25)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: log2(8.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: log10(100.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: sin(pi / 2.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: cos(0.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: tan(0.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: asin(0.5)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: acos(0.5)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: atan(1.0)

Bounded binary elementary equation function with typed non-finite failure.

  • domain: two finite real numeric scalars
  • shape: scalar
  • returns: float
  • example: atan2(1.0, 1.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: sinh(0.5)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: cosh(0.5)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: tanh(0.5)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: asinh(0.5)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: acosh(2.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: atanh(0.5)

Bounded binary elementary equation function with typed non-finite failure.

  • domain: two finite real numeric scalars
  • shape: scalar
  • returns: float
  • example: hypot(3.0, 4.0)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: degrees(pi)

Bounded elementary equation function with typed non-finite failure.

  • domain: one finite numeric, symbolic, or supported dense/domain value
  • shape: elementwise
  • returns: any
  • example: radians(180.0)

Complex conjugation, preserving real values and dense shape.

  • domain: finite real/complex/symbolic scalar or rank-1/rank-2 dense real/complex value
  • shape: elementwise
  • returns: any
  • example: conjugate(imaginary_unit)

Compact alias of conjugate.

  • domain: same finite scalar and dense-container contract as conjugate
  • shape: elementwise
  • returns: any
  • example: conj(imaginary_unit)

Textual alias of complex conjugation.

  • domain: same finite scalar and dense-container contract as conjugate
  • shape: elementwise
  • returns: any
  • example: overbar(imaginary_unit)

Real-part projection preserving dense shape.

  • domain: finite real/complex/symbolic scalar or rank-1/rank-2 dense real/complex value
  • shape: elementwise
  • returns: any
  • example: real_part(imaginary_unit)

Conventional alias of real_part.

  • domain: same finite scalar and dense-container contract as real_part
  • shape: elementwise
  • returns: any
  • example: Re(imaginary_unit)

Imaginary-part projection preserving dense shape; real inputs yield exact or shaped zero.

  • domain: finite real/complex/symbolic scalar or rank-1/rank-2 dense real/complex value
  • shape: elementwise
  • returns: any
  • example: imag_part(imaginary_unit)

Conventional alias of imag_part.

  • domain: same finite scalar and dense-container contract as imag_part
  • shape: elementwise
  • returns: any
  • example: Im(imaginary_unit)

Principal polar pair (radius, angle) with angle in [-pi, pi].

  • domain: one finite real or complex scalar; radius must remain finite
  • shape: scalar
  • returns: any
  • example: polar(imaginary_unit)

floor(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx

Section titled “floor(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx”

Greatest-integer rounding, applied recursively to numeric containers.

  • domain: finite exact/float scalars, symbolic expressions, same-evaluation Approx evidence, recursively numeric list/tuple, rank-1/rank-2 dense-real Tensor, or Embedding coerced to rank-1 Tensor; at most 1,000,000 visited values and nesting depth 128; rank-0/higher-rank tensors, non-finite lanes, and non-numeric containers fail typed
  • shape: elementwise
  • returns: int | rational | float | list | tuple | Tensor | Sym | Approx
  • example: floor(7 / 2)

ceil(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx

Section titled “ceil(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx”

Least-integer rounding, applied recursively to numeric containers.

  • domain: finite exact/float scalars, symbolic expressions, same-evaluation Approx evidence, recursively numeric list/tuple, rank-1/rank-2 dense-real Tensor, or Embedding coerced to rank-1 Tensor; at most 1,000,000 visited values and nesting depth 128; rank-0/higher-rank tensors, non-finite lanes, and non-numeric containers fail typed
  • shape: elementwise
  • returns: int | rational | float | list | tuple | Tensor | Sym | Approx
  • example: ceil(-7 / 2)

round(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx

Section titled “round(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx”

Nearest-integer round-half-to-even, applied recursively to numeric containers.

  • domain: finite exact/float scalars, symbolic expressions, same-evaluation Approx evidence, recursively numeric list/tuple, rank-1/rank-2 dense-real Tensor, or Embedding coerced to rank-1 Tensor; at most 1,000,000 visited values and nesting depth 128; rank-0/higher-rank tensors, non-finite lanes, and non-numeric containers fail typed
  • shape: elementwise
  • returns: int | rational | float | list | tuple | Tensor | Sym | Approx
  • example: round(5 / 2)

trunc(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx

Section titled “trunc(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx”

Round toward zero, applied recursively to numeric containers.

  • domain: finite exact/float scalars, symbolic expressions, same-evaluation Approx evidence, recursively numeric list/tuple, rank-1/rank-2 dense-real Tensor, or Embedding coerced to rank-1 Tensor; at most 1,000,000 visited values and nesting depth 128; rank-0/higher-rank tensors, non-finite lanes, and non-numeric containers fail typed
  • shape: elementwise
  • returns: int | rational | float | list | tuple | Tensor | Sym | Approx
  • example: trunc(-7 / 2)

fract(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx

Section titled “fract(value) -> int | rational | float | list | tuple | Tensor | Sym | Approx”

Signed fractional part x - trunc(x), applied recursively to numeric containers.

  • domain: finite exact/float scalars, symbolic expressions, same-evaluation Approx evidence, recursively numeric list/tuple, rank-1/rank-2 dense-real Tensor, or Embedding coerced to rank-1 Tensor; at most 1,000,000 visited values and nesting depth 128; rank-0/higher-rank tensors, non-finite lanes, and non-numeric containers fail typed
  • shape: elementwise
  • returns: int | rational | float | list | tuple | Tensor | Sym | Approx
  • example: fract(-7 / 2)

Canonical expanded multivariate polynomial in deterministic lexicographic variable order.

  • domain: bounded exact multivariate polynomial over QQ with at most 8 variables, degree 64, and 4096 terms
  • shape: symbolic
  • returns: any
  • example: normalize(("x" + "y")^2)

Collect an exact multivariate polynomial by descending powers of one variable.

  • domain: bounded exact multivariate polynomial over QQ and one symbolic collection variable
  • shape: symbolic
  • returns: any
  • example: collect(("x" + "y")^2, "x")

Exact multivariate resultant using a bounded division-free Sylvester determinant.

  • domain: two bounded exact multivariate polynomials over QQ; Sylvester dimension at most 12
  • shape: symbolic
  • returns: any
  • example: resultant("x"^2 - "y", "x" - 1, "x")

Reduced monic lexicographic Groebner basis from a bounded exact Buchberger computation.

  • domain: 1..16 exact polynomials over QQ, 1..8 ordered variables, basis size at most 32 and at most 2048 Buchberger pairs
  • shape: symbolic
  • returns: any
  • example: groebner(["x"^2 - "y", "x" * "y" - 1], ["x", "y"])

normal_form(expression, basis, variables) -> any

Section titled “normal_form(expression, basis, variables) -> any”

Deterministic exact multivariate remainder modulo an ordered polynomial basis.

  • domain: one exact polynomial, at most 32 exact basis polynomials, and 1..8 ordered variables
  • shape: symbolic
  • returns: any
  • example: normal_form("x"^2, ["x"^2 - "y"], ["x", "y"])

Return the normalized explicit domain assumptions required by a symbolic expression.

  • domain: bounded real symbolic expression with representable nonzero, nonnegative, or positive definedness conditions
  • shape: symbolic
  • returns: any
  • example: assumptions(1 / "x")

cancel(expression) -> tuple[Sym, list[Sym]]

Section titled “cancel(expression) -> tuple[Sym, list[Sym]]”

Condition-aware cancellation returning the simplified expression and every required real-domain condition.

  • domain: bounded real symbolic expressions with explicit representable side conditions
  • shape: symbolic
  • returns: tuple[Sym, list[Sym]]
  • example: cancel("x" / "x")

integrate(expression, variable, lower?, upper?) -> tuple[Sym, list[Sym]]

Section titled “integrate(expression, variable, lower?, upper?) -> tuple[Sym, list[Sym]]”

Exact conditional antiderivative for the bounded polynomial, rational-power, and affine-elementary fragment, or an exact definite integral when bounds are provided.

  • domain: bounded exact rational powers plus affine exp/sin/cos/sinh/cosh/ln/sqrt/reciprocal forms; optional exact bounds must satisfy every side condition
  • shape: symbolic
  • returns: tuple[Sym, list[Sym]]
  • example: integrate("x"^2, "x")

limit(expression, variable, point, side?) -> tuple[Sym, list[Sym]]

Section titled “limit(expression, variable, point, side?) -> tuple[Sym, list[Sym]]”

Exact rational-function limit with one-sided pole behavior or substitution-checked continuous elementary limit, preserving source-domain conditions and typed unknown outcomes.

  • domain: bounded exact univariate rational functions or domain-valid continuous elementary expressions at an exact finite point; side is both, left, or right
  • shape: symbolic
  • returns: tuple[Sym, list[Sym]]
  • example: limit(("x"^2 - 1) / ("x" - 1), "x", 1)

series(expression, variable, point, order) -> tuple[Sym, list[Sym]]

Section titled “series(expression, variable, point, order) -> tuple[Sym, list[Sym]]”

Exact rational-recurrence or derivative-generated Taylor polynomial through the requested order with source-domain conditions.

  • domain: bounded exact univariate rational or differentiable elementary Taylor series at an exact finite point, order 0..=12; Laurent poles unsupported
  • shape: symbolic
  • returns: tuple[Sym, list[Sym]]
  • example: series(1 / (1 - "x"), "x", 0, 3)

Symbolic partial derivative using the checked product, chain, and power rules.

  • domain: bounded exact/formal symbolic expression and one explicit differentiation variable
  • shape: symbolic
  • returns: any
  • example: partial(sin("x") * "x", "x")

taylor(expression, variable, point, order) -> tuple[Sym, list[Sym]]

Section titled “taylor(expression, variable, point, order) -> tuple[Sym, list[Sym]]”

Alias of the checked bounded Taylor-series kernel.

  • domain: bounded exact univariate rational or differentiable elementary Taylor series at an exact finite point, order 0..=12
  • shape: symbolic
  • returns: tuple[Sym, list[Sym]]
  • example: taylor(exp("x"), "x", 0, 4)

symbolic.sum(expression, variable, lower, upper) -> any

Section titled “symbolic.sum(expression, variable, lower, upper) -> any”

Exact bounded inclusive symbolic summation by checked substitution.

  • domain: exact symbolic expression over an inclusive finite i64 interval of at most 1024 terms
  • shape: reduction
  • returns: any
  • example: symbolic.sum("k"^2, "k", 1, 4)

symbolic.product(expression, variable, lower, upper) -> any

Section titled “symbolic.product(expression, variable, lower, upper) -> any”

Exact bounded inclusive symbolic product by checked substitution.

  • domain: exact symbolic expression over an inclusive finite i64 interval of at most 1024 terms
  • shape: reduction
  • returns: any
  • example: symbolic.product("k", "k", 1, 5)

Produce and independently replay an exact polynomial identity certificate authorizing the requested rewrite; never returns Proved from producer output alone.

  • domain: bounded exact ZZ polynomial identity: at most 8 variables, degree 32, 4096 terms, and i128 coefficients
  • shape: constructor
  • returns: ProofResult
  • example: rewrite(("x" + 1)^2, "x"^2 + 2*"x" + 1)

Produce and independently replay an exact ZZ certificate that leftx + righty equals the canonical nonnegative gcd. Results expose typed certificate_data and a domain-separated SHA-256 proof_ref while retaining legacy certificate text and legacy_proof_ref for migration; unsupported bounds return Unknown.

  • domain: exact integers of at most 4,096 bits; producer and independent checker each allow at most 10,000 Euclidean steps
  • shape: constructor
  • returns: ProofResult
  • example: prove_bezout(-240, 46)

verify_bezout(left, right, gcd, left_coefficient, right_coefficient) -> ProofResult

Section titled “verify_bezout(left, right, gcd, left_coefficient, right_coefficient) -> ProofResult”

Independently replay caller-supplied certificate fields; corruption and resource bounds return Unknown and can never forge an accepted proof.

  • domain: caller-supplied v1/ZZ Bézout fields, each at most 4,096 bits; independent checker allows at most 10,000 Euclidean steps
  • shape: constructor
  • returns: ProofResult
  • example: verify_bezout(-240, 46, 2, 9, 47)

Deterministic bounded primality predicate; larger integers return typed NotImplemented.

  • domain: exact non-negative integer through 2^32-1; deterministic bounded trial division
  • shape: scalar
  • returns: bool
  • example: is_prime(104729)

Exact prime factorization as sorted (prime, exponent) pairs; zero and negatives fail typed.

  • domain: exact positive integer through 2^32-1; deterministic bounded trial division
  • shape: constructor
  • returns: list[tuple[int, int]]
  • example: factorint(360)

Least prime strictly greater than value under a bounded deterministic candidate search.

  • domain: exact non-negative integer through 2^32-1; result must remain inside the bounded profile
  • shape: scalar
  • returns: int
  • example: next_prime(100)

Greatest prime strictly less than value; integers <= 2 fail with DomainError.

  • domain: exact integer in 3..=2^32-1; deterministic bounded candidate search
  • shape: scalar
  • returns: int
  • example: prev_prime(100)

Exact Euler totient; zero, negatives, and integers above the bounded profile fail typed.

  • domain: exact positive integer through 2^32-1; deterministic bounded factorization
  • shape: scalar
  • returns: int
  • example: totient(36)

All positive divisors in strictly increasing canonical order.

  • domain: exact positive integer through 2^32-1; deterministic bounded factorization
  • shape: constructor
  • returns: list[int]
  • example: divisors(36)

Exact count of positive divisors from the canonical prime factorization.

  • domain: exact positive integer through 2^32-1; deterministic bounded factorization
  • shape: scalar
  • returns: int
  • example: divisor_count(360)

Exact Möbius function in {-1, 0, 1}; repeated prime factors map to zero.

  • domain: exact positive integer through 2^32-1; deterministic bounded factorization
  • shape: scalar
  • returns: int
  • example: mobius(30)

Canonical modular inverse in 0..modulus via bounded extended Euclid.

  • domain: exact integers under the 16,384-bit ceiling, modulus >= 2, and gcd(value, modulus) = 1
  • shape: scalar
  • returns: int
  • example: mod_inverse(-3, 11)

Generalized Chinese remainder merge returning the least nonnegative solution and LCM modulus; consistent non-coprime systems are supported.

  • domain: equal-length exact integer lists with 0..=256 positive moduli and a consistent generalized CRT system; combined modulus <= 16,384 bits
  • shape: constructor
  • returns: tuple[int, int]
  • example: crt([3, 5, 7], [2, 3, 2])

chinese_remainder(moduli, residues) -> tuple[int, int]

Section titled “chinese_remainder(moduli, residues) -> tuple[int, int]”

Alias of crt, returning the canonical solution and combined modulus.

  • domain: equal-length exact integer lists with 0..=256 positive moduli and a consistent generalized CRT system; combined modulus <= 16,384 bits
  • shape: constructor
  • returns: tuple[int, int]
  • example: chinese_remainder([6, 8], [4, 4])

Floor exact integer root using bounded overflow-aware binary search.

  • domain: nonnegative exact value through 2^32-1 and integer degree in 1..=64
  • shape: scalar
  • returns: int
  • example: integer_nth_root(28, 3)

Canonical finite simple continued fraction using bounded Euclidean division.

  • domain: one exact rational under the scalar bit ceiling
  • shape: constructor
  • returns: list[int]
  • example: continued_fraction(415 / 93)

diophantine(left, right, target) -> tuple[int, int]

Section titled “diophantine(left, right, target) -> tuple[int, int]”

One deterministic exact solution to leftx + righty = target from bounded extended Euclid.

  • domain: three exact integers under the scalar bit ceiling with target divisible by gcd(left, right)
  • shape: constructor
  • returns: tuple[int, int]
  • example: diophantine(15, 21, 6)

Sorted distinct quadratic residues from a bounded exhaustive modular enumeration.

  • domain: positive exact modulus at most 65,536
  • shape: constructor
  • returns: list[int]
  • example: quadratic_residues(11)

discrete_log(base, target, modulus) -> int

Section titled “discrete_log(base, target, modulus) -> int”

Least nonnegative modular exponent from a bounded exhaustive orbit search.

  • domain: exact integer residues with modulus in 2..=65,536 and target in the generated orbit
  • shape: scalar
  • returns: int
  • example: discrete_log(2, 8, 13)

Least primitive root of a bounded prime modulus, qualified against the prime factors of p-1.

  • domain: prime exact modulus in 2..=65,536
  • shape: scalar
  • returns: int
  • example: primitive_root(17)

The index-th prime, 1-indexed (prime_nth(1) = 2), from a preflighted deterministic sieve.

  • domain: exact integer index in 1..=100,000; deterministic bounded sieve
  • shape: scalar
  • returns: int
  • example: prime_nth(25)

Alias of prime_nth.

  • domain: exact integer index in 1..=100,000; deterministic bounded sieve
  • shape: scalar
  • returns: int
  • example: prime(25)

Exact prime-counting function pi(value) over the bounded sieve profile.

  • domain: exact non-negative integer through 2,000,000; deterministic bounded sieve
  • shape: scalar
  • returns: int
  • example: prime_count(100)

Alias of prime_count.

  • domain: exact non-negative integer through 2,000,000; deterministic bounded sieve
  • shape: scalar
  • returns: int
  • example: primepi(541)

interpolate(xs, ys, x) -> int | rational | float

Section titled “interpolate(xs, ys, x) -> int | rational | float”

Evaluate the unique degree <= n-1 interpolating polynomial (Newton form) at the query point; duplicate knots and non-finite values fail typed.

  • domain: 1..=64 distinct knots with equal-length values and a scalar query; all-exact inputs stay exact under the 16,384-bit ceiling, any float input evaluates in strict finite f64
  • shape: reduction
  • returns: int | rational | float
  • example: interpolate([0, 1, 2], [1, 3, 7], 4)

polynomial_interpolate(xs, ys) -> list[int | rational | float]

Section titled “polynomial_interpolate(xs, ys) -> list[int | rational | float]”

Ascending monomial coefficients (exactly one per sample point) of the unique interpolating polynomial; entry i multiplies x^i and trailing zeros are kept.

  • domain: 1..=64 distinct knots with equal-length values; all-exact inputs stay exact under the 16,384-bit ceiling, any float input evaluates in strict finite f64
  • shape: constructor
  • returns: list[int | rational | float]
  • example: polynomial_interpolate([0, 1, 2], [1, 3, 7])

Piecewise-linear interpolation without implicit extrapolation.

  • domain: 1..=64 equal finite samples with strictly increasing knots and a finite query inside the closed knot range
  • shape: reduction
  • returns: float
  • example: linear_interpolate([0.0, 1.0], [2.0, 4.0], 0.25)

Nearest-neighbor interpolation; exact midpoint ties choose the lower knot.

  • domain: 1..=64 equal finite samples with strictly increasing knots and a finite query inside the closed knot range
  • shape: reduction
  • returns: float
  • example: nearest_interpolate([0.0, 1.0], [2.0, 4.0], 0.5)

Natural cubic spline interpolation without implicit extrapolation.

  • domain: 2..=64 equal finite samples with strictly increasing knots and a finite query inside the closed knot range
  • shape: reduction
  • returns: float
  • example: spline([0.0, 1.0, 2.0], [0.0, 1.0, 0.0], 0.5)

Explicit alias of the natural cubic spline evaluator.

  • domain: same bounded natural-cubic contract as spline
  • shape: reduction
  • returns: float
  • example: cubic_spline([0.0, 1.0, 2.0], [0.0, 1.0, 0.0], 0.5)

bspline(control_points, degree, parameter) -> float

Section titled “bspline(control_points, degree, parameter) -> float”

Open-uniform scalar B-spline evaluated by bounded de Boor recursion.

  • domain: 1..=64 finite scalar control points, degree in 0..control_points.len(), and finite parameter in [0, 1]
  • shape: reduction
  • returns: float
  • example: bspline([0.0, 1.0, 0.0], 2, 0.5)

Endpoint-preserving piecewise-linear resampling on a uniform index grid.

  • domain: 1..=1,000,000 finite real values and output count in the same range
  • shape: constructor
  • returns: Vec
  • example: resample([0.0, 2.0], 5)

rbf_interpolate(points, values, query, epsilon) -> float

Section titled “rbf_interpolate(points, values, query, epsilon) -> float”

Gaussian radial-basis interpolation with an explicit shape parameter and checked linear solve.

  • domain: 1..=64 distinct finite points of matching dimension 1..=64, equal finite values, finite query, and epsilon > 0; Gaussian kernel system must pass checked dense solve
  • shape: reduction
  • returns: float
  • example: rbf_interpolate([[0.0], [1.0]], [0.0, 1.0], [0.5], 1.0)

Empirical expectation, identical to the bounded population mean.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: expectation([1.0, 2.0, 3.0])

Alias of expectation.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: E([1.0, 2.0, 3.0])

Population mean using scaled compensated accumulation.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: mean([1.0, 2.0, 3.0])

Population variance with ddof=0 using a two-pass scaled centered moment.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: variance([1.0, 2.0, 3.0])

Alias of population variance.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: Var([1.0, 2.0, 3.0])

Population standard deviation with ddof=0.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: std([1.0, 2.0, 3.0])

Population covariance with ddof=0 over equal-length samples.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: covariance([1.0, 2.0], [2.0, 4.0])

Alias of population covariance.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: Cov([1.0, 2.0], [2.0, 4.0])

Pearson population correlation; zero-variance samples fail typed.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: correlation([1.0, 2.0], [2.0, 4.0])

Alias of Pearson population correlation.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: Corr([1.0, 2.0], [2.0, 4.0])

Shannon entropy in nats over a strict probability simplex.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: entropy([0.25, 0.75])

Alias of Shannon entropy in nats.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: H([0.25, 0.75])

Cross entropy in nats under a strict finite-result simplex contract.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: cross_entropy([0.25, 0.75], [0.5, 0.5])

Kullback-Leibler divergence in nats under a strict finite-result simplex contract.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: kl_divergence([0.25, 0.75], [0.5, 0.5])

Alias of Kullback-Leibler divergence in nats.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: D_KL([0.25, 0.75], [0.5, 0.5])

Symmetric Jensen-Shannon divergence in nats.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: js_divergence([0.25, 0.75], [0.5, 0.5])

Alias of Jensen-Shannon divergence in nats.

  • domain: 1..=1,000,000 finite real values in flat lists, tuples, or rank-1 vectors; population statistics use ddof=0; information statistics require strict simplexes and return nats
  • shape: reduction
  • returns: float
  • example: JS([0.25, 0.75], [0.5, 0.5])

Empirical probability as the bounded mean of an explicit indicator sample.

  • domain: one nonempty finite 0/1 indicator sample of length at most 1,000,000
  • shape: reduction
  • returns: float
  • example: probability([1, 0, 1])

Compact alias of empirical probability.

  • domain: same explicit indicator-sample contract as probability
  • shape: reduction
  • returns: float
  • example: P([1, 0, 1])

conditional_probability(event, condition) -> float

Section titled “conditional_probability(event, condition) -> float”

Empirical P(event | condition) from paired explicit indicators.

  • domain: equal nonempty finite 0/1 indicator samples of length at most 1,000,000 with at least one true condition
  • shape: reduction
  • returns: float
  • example: conditional_probability([1, 0, 1], [1, 1, 0])

Raw empirical moment E[X^order] with compensated accumulation.

  • domain: one nonempty finite-real sample of length at most 1,000,000 and raw integer order in 0..=64; result must remain finite
  • shape: reduction
  • returns: float
  • example: moment([1.0, 2.0, 3.0], 2)

Deterministic linear empirical quantile after total-order sorting.

  • domain: one nonempty finite-real sample of length at most 1,000,000 and finite probability in [0, 1]
  • shape: reduction
  • returns: float
  • example: quantile([1.0, 2.0, 4.0], 0.5)

Pair of exact bin counts and finite edges over an automatic endpoint-inclusive range.

  • domain: one nonempty finite-real sample of length at most 1,000,000 and 1..=65,536 equal-width bins
  • shape: reduction
  • returns: any
  • example: histogram([0.0, 0.5, 1.0], 2)

Discrete mutual information in nats from an explicit joint-probability matrix.

  • domain: one nonempty rank-2 nonnegative joint simplex summing to one within 1e-12
  • shape: reduction
  • returns: float
  • example: mutual_information([[0.5, 0.0], [0.0, 0.5]])

Compact alias of mutual_information.

  • domain: same explicit joint-simplex contract as mutual_information
  • shape: reduction
  • returns: float
  • example: MI([[0.5, 0.0], [0.0, 0.5]])

Normalized categorical posterior from an explicit prior and likelihood vector.

  • domain: equal nonempty finite vectors of length at most 1,000,000; prior is a simplex, likelihoods are nonnegative, and evidence is positive finite
  • shape: constructor
  • returns: Vec
  • example: bayes_update([0.5, 0.5], [0.8, 0.2])

Deterministic rank-1 full linear convolution with compensated accumulation and typed resource/nonfinite failures.

  • domain: two non-empty finite real lists, tuples, or rank-1 vectors whose full output has at most 1,000,000 elements and direct work at most 10,000,000 multiply-adds
  • shape: contraction
  • returns: Vec
  • example: convolve([1.0, 2.0], [3.0, 4.0])

Deterministic rank-1 full linear convolution with compensated accumulation and typed resource/nonfinite failures.

  • domain: two non-empty finite real lists, tuples, or rank-1 vectors whose full output has at most 1,000,000 elements and direct work at most 10,000,000 multiply-adds
  • shape: contraction
  • returns: Vec
  • example: convolve([1.0, 2.0], [3.0, 4.0])

Deterministic rank-1 full cross-correlation in ascending lag order with compensated accumulation and typed resource/nonfinite failures.

  • domain: two non-empty finite real lists, tuples, or rank-1 vectors whose full lag output has at most 1,000,000 elements and direct work at most 10,000,000 multiply-adds
  • shape: contraction
  • returns: Vec
  • example: correlate([1.0, 2.0, 3.0], [4.0, 5.0])

Deterministic rank-1 full cross-correlation in ascending lag order with compensated accumulation and typed resource/nonfinite failures.

  • domain: two non-empty finite real lists, tuples, or rank-1 vectors whose full lag output has at most 1,000,000 elements and direct work at most 10,000,000 multiply-adds
  • shape: contraction
  • returns: Vec
  • example: correlate([1.0, 2.0, 3.0], [4.0, 5.0])

Deterministic forward discrete Fourier transform with the negative-exponent convention and no forward normalization.

  • domain: nonempty finite real/complex rank-1 signal of at most 16,384 points; direct work is capped at 4,194,304 terms
  • shape: transform
  • returns: Vec[float | complex]
  • example: dft([1.0, 0.0, -1.0, 0.0])

Uppercase alias of dft.

  • domain: same bounded signal contract as dft
  • shape: transform
  • returns: Vec[float | complex]
  • example: DFT([1.0, 0.0, -1.0, 0.0])

Deterministic forward FFT with the DFT convention; arbitrary bounded lengths are accepted.

  • domain: nonempty finite real/complex rank-1 signal of at most 16,384 points; power-of-two inputs use radix-2 and other lengths use the bounded direct transform
  • shape: transform
  • returns: Vec[float | complex]
  • example: fft([1.0, 0.0, -1.0, 0.0])

Uppercase alias of fft.

  • domain: same bounded signal contract as fft
  • shape: transform
  • returns: Vec[float | complex]
  • example: FFT([1.0, 0.0, -1.0, 0.0])

Inverse DFT/FFT using positive exponent and exact 1/n normalization.

  • domain: nonempty finite real/complex rank-1 spectrum of at most 16,384 points under the same work ceilings as fft
  • shape: transform
  • returns: Vec[float | complex]
  • example: ifft(fft([1.0, 2.0, 3.0, 4.0]))

Uppercase alias of ifft.

  • domain: same bounded spectrum contract as ifft
  • shape: transform
  • returns: Vec[float | complex]
  • example: IFFT(FFT([1.0, 2.0, 3.0, 4.0]))

autocorrelation(signal) -> Vec[float | complex]

Section titled “autocorrelation(signal) -> Vec[float | complex]”

Full Hermitian autocorrelation in ascending lag order from -(n-1) through n-1.

  • domain: nonempty finite real/complex rank-1 signal whose direct n^2 work is at most 4,194,304 terms
  • shape: transform
  • returns: Vec[float | complex]
  • example: autocorrelation([1.0, 2.0, 3.0])

stft(signal, window_size, hop_size) -> Matrix[float | complex]

Section titled “stft(signal, window_size, hop_size) -> Matrix[float | complex]”

Short-time Fourier transform returning a frame-by-frequency complex matrix with deterministic framing and no implicit padding.

  • domain: nonempty finite real/complex rank-1 signal; 1 <= hop_size <= window_size <= signal length; complete frames only, periodic Hann window, at most 32,000,000 bounded transform-work units
  • shape: transform
  • returns: Matrix[float | complex]
  • example: stft([1.0, 2.0, 3.0, 4.0], 2, 1)

STFT(signal, window_size, hop_size) -> Matrix[float | complex]

Section titled “STFT(signal, window_size, hop_size) -> Matrix[float | complex]”

Short-time Fourier transform returning a frame-by-frequency complex matrix with deterministic framing and no implicit padding.

  • domain: nonempty finite real/complex rank-1 signal; 1 <= hop_size <= window_size <= signal length; complete frames only, periodic Hann window, at most 32,000,000 bounded transform-work units
  • shape: transform
  • returns: Matrix[float | complex]
  • example: stft([1.0, 2.0, 3.0, 4.0], 2, 1)

hilbert_transform(signal) -> Vec[float | complex]

Section titled “hilbert_transform(signal) -> Vec[float | complex]”

Analytic signal formed by the standard one-sided DFT multiplier; the real part reconstructs the input.

  • domain: nonempty finite-real rank-1 signal of at most 16,384 points under the fft work contract
  • shape: transform
  • returns: Vec[float | complex]
  • example: hilbert_transform([1.0, 0.0, -1.0, 0.0])

wavelet(signal, levels) -> Vec[float | complex]

Section titled “wavelet(signal, levels) -> Vec[float | complex]”

Orthonormal Haar discrete wavelet transform with recursively packed approximation/detail coefficients.

  • domain: nonempty finite real/complex power-of-two rank-1 signal through 16,384 points; levels is in 1..=log2(length)
  • shape: transform
  • returns: Vec[float | complex]
  • example: wavelet([1.0, 1.0, -1.0, -1.0], 2)

Deterministic pixel-driven parallel-beam Radon transform using linear detector-bin splatting.

  • domain: nonempty finite rank-2 real image and 1..=720 finite angles in radians; detector count spans the odd diagonal and pixel/angle work is capped at 32,000,000
  • shape: transform
  • returns: Matrix
  • example: radon_transform([[1.0, 0.0], [0.0, 1.0]], [0.0, 1.5707963267948966])

Normal probability density; finite tail underflow returns canonical +0.0.

  • domain: finite real x and loc with finite scale > 0; scalar only; pdf may underflow to +0.0, cdf/sf may saturate within [0, 1], and unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_pdf(1.0, 0.0, 1.0)

Normal log-density computed directly without taking the logarithm of an underflowed density.

  • domain: finite real x and loc with finite scale > 0; scalar only; pdf may underflow to +0.0, cdf/sf may saturate within [0, 1], and unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_logpdf(1.0, 0.0, 1.0)

Normal cumulative distribution with stable finite-tail evaluation and closed [0, 1] saturation.

  • domain: finite real x and loc with finite scale > 0; scalar only; pdf may underflow to +0.0, cdf/sf may saturate within [0, 1], and unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_cdf(1.0, 0.0, 1.0)

Normal survival function evaluated directly rather than as 1 - cdf, preserving upper-tail precision.

  • domain: finite real x and loc with finite scale > 0; scalar only; pdf may underflow to +0.0, cdf/sf may saturate within [0, 1], and unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_sf(1.0, 0.0, 1.0)

Normal log-CDF evaluated directly with stable lower-tail precision.

  • domain: finite real x and loc with finite scale > 0; scalar only; pdf may underflow to +0.0, cdf/sf may saturate within [0, 1], and unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_logcdf(1.0, 0.0, 1.0)

Normal log-survival evaluated directly with stable upper-tail precision.

  • domain: finite real x and loc with finite scale > 0; scalar only; pdf may underflow to +0.0, cdf/sf may saturate within [0, 1], and unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_logsf(1.0, 0.0, 1.0)

Normal quantile for a strict interior probability, with location and scale transformation.

  • domain: finite real p, loc, and scale with 0 < p < 1 and scale > 0; scalar only; unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_ppf(0.975, 0.0, 1.0)

Normal quantile from a strict negative log-probability, preserving underflowed and near-one probabilities.

  • domain: finite real log_p, loc, and scale with log_p < 0 and scale > 0; scalar only; unrepresentable results fail typed
  • shape: scalar
  • returns: float
  • example: normal_logppf(-800.0, 0.0, 1.0)

normal_sample(loc, scale, count, seed) -> Vec

Section titled “normal_sample(loc, scale, count, seed) -> Vec”

Deterministic explicit-seed Normal sampling via SplitMix64 and Box-Muller; no ambient entropy.

  • domain: finite loc, scale > 0, count in 1..=1,000,000, and a nonnegative 64-bit explicit seed
  • shape: constructor
  • returns: Vec
  • example: normal_sample(0.0, 1.0, 4, 42)

Normal [mean, variance, skewness, excess_kurtosis].

  • domain: finite loc and scale > 0
  • shape: constructor
  • returns: Vec
  • example: normal_moments(2.0, 3.0)

Bounded Normal maximum-likelihood [location, scale] fit using stable online moments.

  • domain: 2..=1,000,000 finite real samples with positive MLE variance
  • shape: reduction
  • returns: Vec
  • example: normal_fit([-1.0, 1.0])

normal_log_likelihood(samples, loc, scale) -> float

Section titled “normal_log_likelihood(samples, loc, scale) -> float”

Compensated finite Normal log-likelihood.

  • domain: 1..=1,000,000 finite real samples, finite loc, and scale > 0
  • shape: reduction
  • returns: float
  • example: normal_log_likelihood([-1.0, 1.0], 0.0, 1.0)

bernoulli_pmf(outcome, probability) -> float

Section titled “bernoulli_pmf(outcome, probability) -> float”

Bernoulli probability mass, returning zero outside outcomes {0, 1}.

  • domain: exact integer outcome and finite 0 < probability < 1
  • shape: scalar
  • returns: float
  • example: bernoulli_pmf(1, 0.25)

bernoulli_cdf(outcome, probability) -> float

Section titled “bernoulli_cdf(outcome, probability) -> float”

Bernoulli cumulative distribution.

  • domain: exact integer outcome and finite 0 < probability < 1
  • shape: scalar
  • returns: float
  • example: bernoulli_cdf(0, 0.25)

bernoulli_ppf(quantile, probability) -> int

Section titled “bernoulli_ppf(quantile, probability) -> int”

Bernoulli inverse cumulative distribution.

  • domain: finite strict-interior quantile and 0 < probability < 1
  • shape: scalar
  • returns: int
  • example: bernoulli_ppf(0.8, 0.25)

bernoulli_sample(probability, count, seed) -> list[int]

Section titled “bernoulli_sample(probability, count, seed) -> list[int]”

Deterministic explicit-seed Bernoulli samples.

  • domain: finite 0 < probability < 1, count in 1..=1,000,000, and a nonnegative 64-bit explicit seed
  • shape: constructor
  • returns: list[int]
  • example: bernoulli_sample(0.25, 4, 42)

Bernoulli [mean, variance, skewness, excess_kurtosis].

  • domain: finite 0 < probability < 1
  • shape: constructor
  • returns: Vec
  • example: bernoulli_moments(0.25)

Bernoulli maximum-likelihood probability fit.

  • domain: 1..=1,000,000 exact samples in {0, 1}
  • shape: reduction
  • returns: float
  • example: bernoulli_fit([0, 1, 1, 0])

bernoulli_log_likelihood(samples, probability) -> float

Section titled “bernoulli_log_likelihood(samples, probability) -> float”

Finite Bernoulli log-likelihood.

  • domain: 1..=1,000,000 exact samples in {0, 1} and finite 0 < probability < 1
  • shape: reduction
  • returns: float
  • example: bernoulli_log_likelihood([0, 1], 0.5)

Continuous uniform density on the closed support.

  • domain: finite value and finite high > low
  • shape: scalar
  • returns: float
  • example: uniform_pdf(0.0, -1.0, 1.0)

Continuous uniform cumulative distribution.

  • domain: finite value and finite high > low
  • shape: scalar
  • returns: float
  • example: uniform_cdf(0.0, -1.0, 1.0)

Continuous uniform inverse cumulative distribution.

  • domain: finite 0 < quantile < 1 and finite high > low
  • shape: scalar
  • returns: float
  • example: uniform_ppf(0.75, -1.0, 1.0)

uniform_sample(low, high, count, seed) -> Vec

Section titled “uniform_sample(low, high, count, seed) -> Vec”

Deterministic explicit-seed continuous uniform samples.

  • domain: finite high > low, count in 1..=1,000,000, and a nonnegative 64-bit explicit seed
  • shape: constructor
  • returns: Vec
  • example: uniform_sample(-1.0, 1.0, 4, 42)

Continuous uniform [mean, variance, skewness, excess_kurtosis].

  • domain: finite high > low
  • shape: constructor
  • returns: Vec
  • example: uniform_moments(-1.0, 1.0)

Continuous uniform [low, high] maximum-likelihood support fit.

  • domain: 1..=1,000,000 finite real samples with distinct extrema
  • shape: reduction
  • returns: Vec
  • example: uniform_fit([-2.0, 1.0, 4.0])

uniform_log_likelihood(samples, low, high) -> float

Section titled “uniform_log_likelihood(samples, low, high) -> float”

Finite continuous uniform log-likelihood; out-of-support samples fail typed.

  • domain: 1..=1,000,000 finite real samples all inside finite high > low
  • shape: reduction
  • returns: float
  • example: uniform_log_likelihood([-1.0, 1.0], -2.0, 2.0)

Exponential density, zero below its support.

  • domain: finite value and finite rate > 0
  • shape: scalar
  • returns: float
  • example: exponential_pdf(1.0, 2.0)

Stable exponential cumulative distribution.

  • domain: finite value and finite rate > 0
  • shape: scalar
  • returns: float
  • example: exponential_cdf(1.0, 2.0)

Exponential inverse cumulative distribution using log1p.

  • domain: finite 0 < quantile < 1 and finite rate > 0
  • shape: scalar
  • returns: float
  • example: exponential_ppf(0.8, 2.0)

exponential_sample(rate, count, seed) -> Vec

Section titled “exponential_sample(rate, count, seed) -> Vec”

Deterministic explicit-seed exponential samples by inverse transform.

  • domain: finite rate > 0, count in 1..=1,000,000, and a nonnegative 64-bit explicit seed
  • shape: constructor
  • returns: Vec
  • example: exponential_sample(2.0, 4, 42)

Exponential [mean, variance, skewness, excess_kurtosis].

  • domain: finite rate > 0
  • shape: constructor
  • returns: Vec
  • example: exponential_moments(2.0)

Exponential maximum-likelihood rate fit.

  • domain: 1..=1,000,000 finite nonnegative samples with positive sum
  • shape: reduction
  • returns: float
  • example: exponential_fit([0.25, 0.75])

exponential_log_likelihood(samples, rate) -> float

Section titled “exponential_log_likelihood(samples, rate) -> float”

Compensated finite exponential log-likelihood.

  • domain: 1..=1,000,000 finite nonnegative samples and finite rate > 0
  • shape: reduction
  • returns: float
  • example: exponential_log_likelihood([0.25, 0.75], 2.0)

Poisson probability mass with log-gamma scaling; negative outcomes return zero.

  • domain: exact integer outcome and finite 0 < rate <= 64
  • shape: scalar
  • returns: float
  • example: poisson_pmf(4, 4.0)

Poisson cumulative distribution by bounded compensated recurrence.

  • domain: exact integer outcome, finite 0 < rate <= 64, and at most 1,000,000 recurrence steps
  • shape: scalar
  • returns: float
  • example: poisson_cdf(4, 4.0)

Poisson inverse cumulative distribution by bounded recurrence.

  • domain: finite 0 < quantile < 1, finite 0 < rate <= 64, and at most 1,000,000 recurrence steps
  • shape: scalar
  • returns: int
  • example: poisson_ppf(0.5, 4.0)

poisson_sample(rate, count, seed) -> list[int]

Section titled “poisson_sample(rate, count, seed) -> list[int]”

Deterministic explicit-seed Poisson samples using bounded Knuth draws.

  • domain: finite 0 < rate <= 64, count in 1..=1,000,000, a nonnegative 64-bit explicit seed, and at most 32,000,000 draws
  • shape: constructor
  • returns: list[int]
  • example: poisson_sample(4.0, 4, 42)

Poisson [mean, variance, skewness, excess_kurtosis].

  • domain: finite 0 < rate <= 64
  • shape: constructor
  • returns: Vec
  • example: poisson_moments(4.0)

Poisson maximum-likelihood rate fit.

  • domain: 1..=1,000,000 exact nonnegative samples
  • shape: reduction
  • returns: float
  • example: poisson_fit([2, 4, 6])

poisson_log_likelihood(samples, rate) -> float

Section titled “poisson_log_likelihood(samples, rate) -> float”

Compensated finite Poisson log-likelihood.

  • domain: 1..=1,000,000 exact nonnegative samples and finite 0 < rate <= 64
  • shape: reduction
  • returns: float
  • example: poisson_log_likelihood([2, 4, 6], 4.0)

Simple ordinary least squares returning [slope, intercept, Pearson r, two-sided p-value, slope stderr, intercept stderr].

  • domain: equal finite vectors of length 3..=1,000,000 with nonconstant xs; finite ordinary least-squares outputs
  • shape: reduction
  • returns: Vec
  • example: linear_regression([1.0, 2.0, 3.0], [2.0, 4.0, 5.0])

Descriptive alias of linear_regression with the same six-field evidence vector.

  • domain: same bounded simple ordinary least-squares contract as linear_regression
  • shape: reduction
  • returns: Vec
  • example: regression([1.0, 2.0, 3.0], [2.0, 4.0, 5.0])

Pearson product-moment correlation and finite two-sided Student-t p-value.

  • domain: equal finite vectors of length 3..=1,000,000 with positive variance on both sides
  • shape: reduction
  • returns: Vec
  • example: pearson_test([1.0, 2.0, 3.0], [1.0, 2.0, 4.0])

Spearman average-tie rank correlation with asymptotic two-sided p-value.

  • domain: equal finite vectors of length 3..=100,000 with nonconstant average-tie ranks
  • shape: reduction
  • returns: Vec
  • example: spearman_test([1.0, 2.0, 2.0, 4.0], [4.0, 1.0, 2.0, 3.0])

t_test_1samp(samples, expected_mean) -> Vec

Section titled “t_test_1samp(samples, expected_mean) -> Vec”

One-sample Student t statistic, two-sided p-value, and degrees of freedom.

  • domain: 2..=1,000,000 finite samples with positive variance and a finite expected mean
  • shape: reduction
  • returns: Vec
  • example: t_test_1samp([1.0, 2.0, 4.0], 2.0)

Welch independent-samples t statistic, two-sided p-value, and effective degrees of freedom.

  • domain: two finite samples of length 2..=1,000,000 with positive combined Welch variance
  • shape: reduction
  • returns: Vec
  • example: t_test_ind([1.0, 2.0, 3.0], [3.0, 4.0, 6.0])

Paired-samples t statistic, two-sided p-value, and degrees of freedom.

  • domain: equal finite vectors of length 2..=1,000,000 with positive paired-difference variance
  • shape: reduction
  • returns: Vec
  • example: t_test_rel([1.0, 2.0, 4.0], [1.5, 1.5, 2.0])

chi_square_test(observed, expected) -> Vec

Section titled “chi_square_test(observed, expected) -> Vec”

Pearson chi-square goodness-of-fit statistic, survival probability, and degrees of freedom.

  • domain: equal finite vectors of length 2..=1,000,000; observed >= 0, expected > 0, and totals equal within 64 eps
  • shape: reduction
  • returns: Vec
  • example: chi_square_test([12.0, 18.0, 30.0], [15.0, 15.0, 30.0])

Classical one-way ANOVA F statistic, survival probability, numerator degrees of freedom, and denominator degrees of freedom.

  • domain: a list or tuple of at least two nonempty finite-real groups, at most 1,000,000 total observations, positive within-group variance, and total observations > groups
  • shape: reduction
  • returns: Vec
  • example: anova_oneway([[1.0, 2.0, 3.0], [3.0, 4.0, 6.0]])

Mann-Whitney U for the first sample with tie correction, continuity correction, and asymptotic two-sided p-value.

  • domain: two nonempty finite samples with at most 100,000 combined sortable observations and positive tie-corrected variance
  • shape: reduction
  • returns: Vec
  • example: mann_whitney_u([1.0, 2.0, 3.0], [3.0, 4.0, 6.0])

ks_normal_test(samples, loc, scale) -> Vec

Section titled “ks_normal_test(samples, loc, scale) -> Vec”

One-sample Kolmogorov-Smirnov statistic against a Normal CDF with bounded asymptotic two-sided p-value.

  • domain: 1..=100,000 finite sortable observations, finite loc, and finite scale > 0
  • shape: reduction
  • returns: Vec
  • example: ks_normal_test([-1.0, 0.0, 1.0], 0.0, 1.0)

Exact binomial coefficient; descriptive alias of C(n, k).

  • domain: exact machine integers with n >= 0 and 0 <= k <= n
  • shape: scalar
  • returns: int
  • example: choose(8, 3)

Python-compatible modulo as a callable alias of the % operator.

  • domain: two compatible exact, finite-real, symbolic, vector, or matrix numeric operands under ordinary equation broadcasting rules; divisor must be nonzero
  • shape: elementwise
  • returns: any
  • example: mod(17, 5)

Finite-real beta function evaluated through a stable log-gamma quotient.

  • domain: two positive finite real scalars with a finite log-gamma result
  • shape: scalar
  • returns: float
  • example: beta(2.0, 3.0)

Integer-order Bessel function of the first kind through the pinned libm kernel.

  • domain: integer order fitting i32 and a finite real scalar whose result remains finite
  • shape: scalar
  • returns: float
  • example: bessel_j(0, 1.0)

Integer-order Bessel function of the second kind through the pinned libm kernel.

  • domain: integer order fitting i32 and a positive finite real scalar whose result remains finite
  • shape: scalar
  • returns: float
  • example: bessel_y(0, 1.0)

Bounded finite-real Riemann zeta using a fixed Euler-Maclaurin evaluation.

  • domain: finite real s > 0 except the pole at s = 1
  • shape: scalar
  • returns: float
  • example: zeta(2.0)

Bounded finite-real polylogarithm from its defining convergent series.

  • domain: finite real order and argument |z| < 1, converging within 100,000 compensated series terms
  • shape: scalar
  • returns: float
  • example: polylog(2.0, 0.5)

Legendre polynomial evaluated by its checked three-term recurrence.

  • domain: integer order 0..=10,000 and finite real scalar with finite recurrence intermediates
  • shape: scalar
  • returns: float
  • example: legendre(3, 0.5)

Physicists’ Hermite polynomial evaluated by its checked three-term recurrence.

  • domain: integer order 0..=10,000 and finite real scalar with finite recurrence intermediates
  • shape: scalar
  • returns: float
  • example: hermite(3, 0.5)

Natural logarithm of absolute gamma through the pinned finite libm kernel.

  • domain: one finite real scalar whose log-gamma result remains finite
  • shape: scalar
  • returns: float
  • example: lgamma(5.0)

Error function through the pinned finite libm kernel.

  • domain: one finite real scalar
  • shape: scalar
  • returns: float
  • example: erf(0.5)

Complementary error function through the pinned finite libm kernel.

  • domain: one finite real scalar
  • shape: scalar
  • returns: float
  • example: erfc(0.5)

Unicode alias of the checked gamma function.

  • domain: same bounded finite scalar/tensor domain as gamma
  • shape: elementwise
  • returns: float | Tensor
  • example: Γ(4.0)

Unicode alias of the checked beta function.

  • domain: same positive finite-real domain as beta
  • shape: scalar
  • returns: float
  • example: Β(2.0, 3.0)

Unicode alias of the checked integer-order Bessel J function.

  • domain: same bounded integer-order finite-real domain as bessel_j
  • shape: scalar
  • returns: float
  • example: Jν(0, 1.0)

Unicode alias of the checked integer-order Bessel Y function.

  • domain: same bounded integer-order positive-real domain as bessel_y
  • shape: scalar
  • returns: float
  • example: Yν(0, 1.0)

Unicode alias of the bounded Riemann zeta function.

  • domain: same finite-real domain as zeta
  • shape: scalar
  • returns: float
  • example: ζ(2.0)

Strict numeric greater-than predicate with exact comparison before any float boundary.

  • domain: two ordered finite real or exact rational scalars
  • shape: scalar
  • returns: bool
  • example: greater(3, 2)

Maximum of an explicit bounded finite numeric iterable.

  • domain: one nonempty flat iterable of at most 1,000,000 finite real values
  • shape: reduction
  • returns: float
  • example: supremum([1.0, 4.0, 2.0])

Compact alias of supremum.

  • domain: same bounded finite-iterable contract as supremum
  • shape: reduction
  • returns: float
  • example: sup([1.0, 4.0, 2.0])

Minimum of an explicit bounded finite numeric iterable.

  • domain: one nonempty flat iterable of at most 1,000,000 finite real values
  • shape: reduction
  • returns: float
  • example: infimum([1.0, 4.0, 2.0])

Compact alias of infimum.

  • domain: same bounded finite-iterable contract as infimum
  • shape: reduction
  • returns: float
  • example: inf([1.0, 4.0, 2.0])

Euclidean distance with checked shape, dimension, and finite-result bounds.

  • domain: matching nonempty finite-real vectors of dimension 1..=64
  • shape: bounded geometry / manifold
  • returns: float
  • example: distance([0.0, 0.0], [3.0, 4.0])

Compact alias of distance.

  • domain: same bounded Euclidean-vector contract as distance
  • shape: bounded geometry / manifold
  • returns: float
  • example: d([0.0, 0.0], [3.0, 4.0])

Principal Euclidean vector angle in [0, pi], with clamped roundoff and typed zero-vector failure.

  • domain: matching nonzero finite-real vectors of dimension 1..=64
  • shape: bounded geometry / manifold
  • returns: float
  • example: angle([1.0, 0.0], [0.0, 1.0])

coordinate_transform(matrix, point, offset) -> Vec

Section titled “coordinate_transform(matrix, point, offset) -> Vec”

Explicit affine coordinate transform matrix * point + offset.

  • domain: finite dense-real matrix with 1..=64 rows, columns equal to point dimension, and offset length equal to rows
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: coordinate_transform([[0.0, -1.0], [1.0, 0.0]], [2.0, 3.0], [1.0, -1.0])

Bounded central-difference gradient of a scalar field.

  • domain: one-argument scalar field, finite point of dimension 1..=64, finite step > 0, and at most 1,024 central-difference evaluations
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: field.gradient(scalar_field, [1.0, 2.0, 3.0], 0.0001)

Bounded central-difference divergence of a vector field.

  • domain: one-argument vector field returning the point dimension, finite point dimension 1..=64, finite step > 0, and at most 1,024 evaluations
  • shape: bounded geometry / manifold
  • returns: float
  • example: divergence(vector_field, [1.0, 2.0, 3.0], 0.0001)

Compact alias of divergence.

  • domain: same bounded vector-field contract as divergence
  • shape: bounded geometry / manifold
  • returns: float
  • example: div(vector_field, [1.0, 2.0, 3.0], 0.0001)

Bounded central-difference curl in three dimensions.

  • domain: one-argument three-dimensional finite vector field and finite step > 0 under six evaluations
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: curl(vector_field, [1.0, 2.0, 3.0], 0.0001)

Bounded central-difference scalar Laplacian.

  • domain: one-argument scalar field, finite point dimension 1..=64, finite step > 0, and at most 1,024 evaluations
  • shape: bounded geometry / manifold
  • returns: float
  • example: laplacian(scalar_field, [1.0, 2.0, 3.0], 0.0001)

Deterministic monotone-chain planar convex hull without a repeated closing point.

  • domain: 1..=4,096 finite two-dimensional points
  • shape: bounded geometry / manifold
  • returns: Matrix
  • example: convex_hull([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.5, 0.5]])

Compact alias of convex_hull.

  • domain: same bounded planar point contract as convex_hull
  • shape: bounded geometry / manifold
  • returns: Matrix
  • example: conv([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]])

Affine-hull origin followed by a deterministic orthonormal basis from modified Gram-Schmidt.

  • domain: 1..=4,096 matching finite-real points of dimension 1..=64
  • shape: bounded geometry / manifold
  • returns: Matrix
  • example: affine_hull([[1.0, 2.0], [2.0, 2.0], [1.0, 4.0]])

Compact alias of affine_hull.

  • domain: same bounded finite point contract as affine_hull
  • shape: bounded geometry / manifold
  • returns: Matrix
  • example: aff([[1.0, 2.0], [2.0, 2.0], [1.0, 4.0]])

Absolute simplex determinant divided by dimension factorial.

  • domain: exactly dimension + 1 finite-real simplex vertices in dimension 1..=16
  • shape: bounded geometry / manifold
  • returns: float
  • example: volume([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]])

Compact alias of volume.

  • domain: same bounded simplex contract as volume
  • shape: bounded geometry / manifold
  • returns: float
  • example: vol([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]])

geodesic(start, target, radius, segments) -> Matrix

Section titled “geodesic(start, target, radius, segments) -> Matrix”

Sampled shortest round-sphere geodesic through logarithmic and exponential maps, including both endpoints.

  • domain: non-antipodal matching points on a finite positive-radius round sphere, dimension 1..=64, and segments in 1..=4095
  • shape: bounded geometry / manifold
  • returns: Matrix
  • example: geodesic([1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 1.0, 4)

Radial projection onto a round sphere.

  • domain: nonzero finite-real point of dimension 1..=64 and finite radius > 0
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: sphere.project([2.0, 0.0, 0.0], 1.0)

sphere.tangent(point, vector, radius) -> Vec

Section titled “sphere.tangent(point, vector, radius) -> Vec”

Orthogonal projection of an ambient vector into a round-sphere tangent space.

  • domain: matching finite vectors of dimension 1..=64, point on the positive-radius sphere
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: sphere.tangent([1.0, 0.0, 0.0], [1.0, 1.0, 0.0], 1.0)

Closed-form round-sphere exponential map after checked tangent projection.

  • domain: point on a finite positive-radius sphere and matching finite ambient tangent vector, dimension 1..=64
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: sphere.exp([1.0, 0.0, 0.0], [0.0, 1.5707963267948966, 0.0], 1.0)

Principal round-sphere logarithmic map; antipodal ambiguity fails typed.

  • domain: matching non-antipodal points on a finite positive-radius sphere, dimension 1..=64
  • shape: bounded geometry / manifold
  • returns: Vec
  • example: sphere.log([1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 1.0)

sphere.distance(point, target, radius) -> float

Section titled “sphere.distance(point, target, radius) -> float”

Principal round-sphere geodesic distance.

  • domain: matching points on a finite positive-radius sphere, dimension 1..=64
  • shape: bounded geometry / manifold
  • returns: float
  • example: sphere.distance([1.0, 0.0, 0.0], [0.0, 1.0, 0.0], 1.0)

Exact F2 Betti numbers of the complete downward closure of finite maximal simplices.

  • domain: 1..=4,096 maximal nonempty simplices with nonnegative exact vertices, at most 13 vertices per facet, 4,096 distinct vertices, 32,768 closure simplices, 4,000,000 boundary words, and 100,000,000 elimination XORs
  • shape: finite simplicial topology
  • returns: list[int]
  • example: betti_numbers([[0, 1], [1, 2], [0, 2]])

Exact alternating simplex-count Euler characteristic.

  • domain: same bounded finite simplicial-complex contract as betti_numbers
  • shape: finite simplicial topology
  • returns: int
  • example: euler_characteristic([[0, 1, 2]])

simplicial_topology(facets) -> tuple[list[int], list[int], int]

Section titled “simplicial_topology(facets) -> tuple[list[int], list[int], int]”

Exact tuple of Betti numbers, simplex counts by dimension, and Euler characteristic.

  • domain: same bounded finite simplicial-complex contract as betti_numbers
  • shape: finite simplicial topology
  • returns: tuple[list[int], list[int], int]
  • example: simplicial_topology([[0, 1, 2]])

finite_difference(values, order) -> list[int]

Section titled “finite_difference(values, order) -> list[int]”

Exact forward finite differences at the requested order.

  • domain: 1..=4,096 exact integers, order nonnegative and smaller than the input length, exact intermediates at most 16,384 bits
  • shape: bounded discrete / graph
  • returns: list[int]
  • example: finite_difference([1, 4, 9, 16], 2)

recurrence(initial, coefficients, count) -> list[int]

Section titled “recurrence(initial, coefficients, count) -> list[int]”

Exact constant-coefficient recurrence where coefficient j multiplies the j-th preceding term.

  • domain: matching initial/coefficient lengths in 1..=64, count from the order through 100,000, exact values at most 16,384 bits, and at most 100,000,000 multiply-adds
  • shape: bounded discrete / graph
  • returns: list[int]
  • example: recurrence([0, 1], [1, 1], 8)

combinations(values, choose) -> list[list[int]]

Section titled “combinations(values, choose) -> list[list[int]]”

Lexicographically indexed combinations preserving input order and position multiplicity.

  • domain: 1..=128 exact integers, choose in 0..=length, and at most 100,000 position-distinct outputs
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: combinations([1, 2, 3], 2)

permutations(values, length) -> list[list[int]]

Section titled “permutations(values, length) -> list[list[int]]”

Deterministic partial permutations preserving input position identity.

  • domain: 1..=128 exact integers, length in 0..=input length, and at most 100,000 position-distinct outputs
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: permutations([1, 2, 3], 2)

integer_partitions(value) -> list[list[int]]

Section titled “integer_partitions(value) -> list[list[int]]”

Exact integer partitions in descending lexicographic part order.

  • domain: positive exact integer at most 128 and at most 100,000 outputs
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: integer_partitions(5)

Unsigned Stirling number of the first kind or set-partition Stirling number of the second kind.

  • domain: 0 <= k <= n <= 256, kind exactly 1 or 2, and exact intermediates at most 16,384 bits
  • shape: bounded discrete / graph
  • returns: int
  • example: stirling_numbers(5, 2, 2)

Exact divisor-poset Möbius inversion returning f(1)..f(n).

  • domain: 1..=4,096 exact values g(1)..g(n), interpreted as g(n)=sum over divisors d of f(d), with 16,384-bit results
  • shape: bounded discrete / graph
  • returns: list[int]
  • example: mobius_inversion([1, 3, 4, 7])

shortest_path(adjacency, source, target) -> tuple[float, list[int]]

Section titled “shortest_path(adjacency, source, target) -> tuple[float, list[int]]”

Deterministic Dijkstra distance and vertex path for a directed nonnegative graph.

  • domain: finite nonnegative square weighted adjacency of size 1..=512, zero meaning no edge, in-range vertices, reachable target, and finite path sums
  • shape: bounded discrete / graph
  • returns: tuple[float, list[int]]
  • example: shortest_path([[0.0, 2.0, 5.0], [0.0, 0.0, 1.0], [0.0, 0.0, 0.0]], 0, 2)

connected_components(adjacency) -> list[list[int]]

Section titled “connected_components(adjacency) -> list[list[int]]”

Canonical ascending weakly connected components.

  • domain: finite nonnegative square adjacency of size 1..=512; directed edges are interpreted by weak connectivity
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: connected_components([[0.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 0.0]])

Deterministic Edmonds-Karp maximum-flow value with bounded residual work.

  • domain: finite nonnegative square capacities of size 1..=128, distinct in-range source/sink, at most 100,000,000 residual-edge visits, and finite totals
  • shape: bounded discrete / graph
  • returns: float
  • example: max_flow([[0.0, 3.0, 2.0, 0.0], [0.0, 0.0, 1.0, 2.0], [0.0, 0.0, 0.0, 3.0], [0.0, 0.0, 0.0, 0.0]], 0, 3)

Deterministic maximum-cardinality bipartite matching as sorted [left, right] pairs.

  • domain: finite nonnegative rectangular bipartite adjacency with each side in 1..=512
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: matching([[1.0, 1.0, 0.0], [0.0, 1.0, 1.0]])

Deterministic vertex-order greedy proper coloring; color ids are zero-based and no minimum-color claim is made.

  • domain: finite nonnegative symmetric loop-free adjacency of size 1..=512
  • shape: bounded discrete / graph
  • returns: list[int]
  • example: coloring([[0.0, 1.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 0.0]])

Unnormalized weighted graph Laplacian D - A.

  • domain: finite nonnegative symmetric loop-free weighted adjacency of size 1..=512 with finite degree sums
  • shape: bounded discrete / graph
  • returns: Matrix
  • example: graph_laplacian([[0.0, 2.0], [2.0, 0.0]])

Explicit discrete-time orbit including the initial state and every callback-produced iterate.

  • domain: one-argument state update preserving a finite dense-real dimension in 1..=64, steps in 0..=100,000, and bounded output storage
  • shape: bounded discrete / graph
  • returns: Matrix
  • example: orbit(discrete_update, [0.0], 3)

csp(domains, relations, max_solutions) -> list[list[int]]

Section titled “csp(domains, relations, max_solutions) -> list[list[int]]”

Exhaustively solve a bounded pure finite table-CSP in canonical lexicographic order; output ceilings fail typed rather than returning a model prefix.

  • domain: 1..=12 explicit finite exact-integer domains; pure [variable_indices, allowed_tuples] table relations; at most 1,000,000 assignments, 20,000,000 relation cells, and an exact 1..=4,096 model output ceiling
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: csp([[0, 1, 2], [0, 1, 2]], [[[0, 1], [[0, 2], [1, 1], [2, 0]]]], 8)

solve_constraints(domains, relations, max_solutions) -> list[list[int]]

Section titled “solve_constraints(domains, relations, max_solutions) -> list[list[int]]”

Enumerate the complete bounded finite model set without invoking user callbacks or effects.

  • domain: same exact bounded finite table-CSP contract as csp
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: solve_constraints([[0, 1]], [[[0], [[1]]]], 4)

Decide satisfiability for a bounded finite table-CSP; false is backed by exhaustive enumeration of the accepted search space.

  • domain: same exact bounded finite table-CSP contract as csp; decision may stop at the first canonical model
  • shape: bounded discrete / graph
  • returns: bool
  • example: sat([[0, 1]], [[[0], [[1]]]])

Validate endpoint closure, composition totality on composable pairs, identities, and associativity for a finite category.

  • domain: finite category encoded as [object_count, sources, targets, identities, composition], with 1..=64 objects, 1..=128 morphisms, exact in-range indices, -1 only for non-composable pairs, and bounded exhaustive law checks
  • shape: bounded discrete / graph
  • returns: bool
  • example: category_validate([2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]])

category_compose(category, after, before) -> int

Section titled “category_compose(category, after, before) -> int”

Compose two morphisms only after replaying the complete finite-category laws.

  • domain: valid bounded finite category and two in-range composable morphism indices; composition orientation is after o before
  • shape: bounded discrete / graph
  • returns: int
  • example: category_compose([2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]], 1, 2)

category_hom(category, source, target) -> list[int]

Section titled “category_hom(category, source, target) -> list[int]”

Return canonical ascending morphism indices in the requested finite hom-set.

  • domain: valid bounded finite category and two in-range object indices
  • shape: bounded discrete / graph
  • returns: list[int]
  • example: category_hom([2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]], 0, 1)

category_isomorphisms(category) -> list[list[int]]

Section titled “category_isomorphisms(category) -> list[list[int]]”

Return canonical [morphism, inverse] pairs whose two compositions are the corresponding identities.

  • domain: valid bounded finite category
  • shape: bounded discrete / graph
  • returns: list[list[int]]
  • example: category_isomorphisms([2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]])

functor_validate(source, target, object_map, morphism_map) -> bool

Section titled “functor_validate(source, target, object_map, morphism_map) -> bool”

Check endpoint, identity, and composition preservation for a total finite functor map.

  • domain: two valid bounded finite categories and complete in-range object/morphism maps
  • shape: bounded discrete / graph
  • returns: bool
  • example: functor_validate([2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]], [2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]], [0, 1], [0, 1, 2])

natural_transformation_validate(source, target, left_objects, left_morphisms, right_objects, right_morphisms, components) -> bool

Section titled “natural_transformation_validate(source, target, left_objects, left_morphisms, right_objects, right_morphisms, components) -> bool”

Check component endpoints and every naturality square for two bounded finite functors.

  • domain: two valid bounded finite categories, two valid functor maps, and one in-range component morphism per source object
  • shape: bounded discrete / graph
  • returns: bool
  • example: natural_transformation_validate([2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]], [2, [0, 1, 0], [0, 1, 1], [0, 1], [[0, -1, -1], [-1, 1, 2], [2, -1, -1]]], [0, 1], [0, 1, 2], [0, 1], [0, 1, 2], [0, 1])

Infer the exact type of a bounded STLC term; unbound variables and ill-typed eliminations fail typed.

  • domain: tagged simply typed lambda-calculus term with de Bruijn indices, Unit/Bool/Nat/function/product/sum types, at most 256 context entries, depth 128, 4,096 combined term/annotation nodes, and 4,096 context type nodes
  • shape: symbolic
  • returns: any
  • example: stlc_type(["lam", "Nat", ["var", 0]], [])

stlc_check(term, context, expected) -> bool

Section titled “stlc_check(term, context, expected) -> bool”

Compare bounded STLC inference with an explicit well-formed expected type.

  • domain: same bounded STLC term/context contract as stlc_type and one well-formed expected type
  • shape: symbolic
  • returns: bool
  • example: stlc_check(["app", ["lam", "Nat", ["var", 0]], ["nat", 7]], [], "Nat")

Compute capture-avoiding leftmost-outermost beta/product/sum/boolean/Nat normal form or fail on budget exhaustion.

  • domain: closed well-typed bounded STLC term, reduction budget 0..=10,000, and normalized output at most 100,000 combined term/annotation nodes
  • shape: symbolic
  • returns: any
  • example: stlc_normalize(["app", ["lam", "Nat", ["var", 0]], ["nat", 7]], 1)

stlc_definitional_equal(left, right, max_steps) -> bool

Section titled “stlc_definitional_equal(left, right, max_steps) -> bool”

Decide bounded STLC definitional equality only between terms of the same inferred type by exact capture-avoiding normalization.

  • domain: two closed well-typed bounded STLC terms and a per-term reduction budget 0..=10,000
  • shape: symbolic
  • returns: bool
  • example: stlc_definitional_equal(["app", ["lam", "Nat", ["var", 0]], ["nat", 7]], ["nat", 7], 1)

ode(rhs, t0, y0, t1, rtol, atol, max_steps, params, method) -> tuple[Approx[Vec], int, int]

Section titled “ode(rhs, t0, y0, t1, rtol, atol, max_steps, params, method) -> tuple[Approx[Vec], int, int]”

Bounded ODE solver selected by its final method argument: rk45 is adaptive Dormand-Prince 5(4), while backward_euler is an implicit first-order stiff method with adaptive step doubling and bounded finite-difference Newton solves. Both return (Approx(final_state), accepted_steps, rejected_steps); parameter-vector items follow (t, y). Unsupported methods, events, dense output, and sensitivities fail typed.

  • domain: finite dense real state; rk45 supports dimension 1..=256, while backward_euler supports 1..=32 with bounded finite-difference Newton work; finite rtol > 0, atol >= 0, max_steps in 1..=1,000,000, finite real parameter vector of length 0..=64, and a final supported literal solver id
  • shape: time evolution
  • returns: tuple[Approx[Vec], int, int]
  • example: ode(ode_rhs, 0.0, [1.0], 1.0, 1e-9, 1e-12, 10000, [], "rk45")

dae(residual, t0, y0, ydot0, t1, rtol, atol, max_steps, params, method) -> tuple[Approx[Vec], int, int]

Section titled “dae(residual, t0, y0, ydot0, t1, rtol, atol, max_steps, params, method) -> tuple[Approx[Vec], int, int]”

Bounded residual-form index-1 DAE integration by implicit Euler with adaptive step doubling. Initial residual consistency, every nonlinear solve, state shape, finiteness, callback evaluations, and step work fail typed; returns (Approx(final_state), accepted_steps, rejected_steps).

  • domain: consistent residual-form index-1 finite dense-real DAE F(t, y, ydot)=0 of dimension 1..=32; bounded finite-difference Newton work, finite tolerances, 1..=1,000,000 steps, 0..=64 parameters, and final literal method backward_euler
  • shape: time evolution
  • returns: tuple[Approx[Vec], int, int]
  • example: dae(dae_residual_system, 0.0, [1.0, 1.0], [-1.0, -2.0], 0.1, 1e-5, 1e-8, 10000, [], "backward_euler")

poisson(source, x0, x1, left, right) -> Approx[Vec]

Section titled “poisson(source, x0, x1, left, right) -> Approx[Vec]”

Solve -u’’=source on a bounded uniform one-dimensional grid by a centered second-order Dirichlet tridiagonal solve; returns an Approx vector including both boundaries and a normalized discrete residual.

  • domain: one-dimensional uniform grid, 1..=4,094 finite interior source samples, finite x1 > x0, and fixed finite Dirichlet boundaries
  • shape: time evolution
  • returns: Approx[Vec]
  • example: poisson([2.0, 2.0, 2.0], 0.0, 1.0, 0.0, 0.0)

heat_equation(initial, diffusivity, dx, dt, steps, left, right) -> Approx[Vec]

Section titled “heat_equation(initial, diffusivity, dx, dt, steps, left, right) -> Approx[Vec]”

Evolve the one-dimensional heat equation by unconditionally stable Crank-Nicolson tridiagonal steps; returns an Approx final grid with the final normalized discrete residual.

  • domain: one-dimensional uniform grid of 3..=4,096 finite points with matching fixed Dirichlet endpoints, finite diffusivity > 0, dx > 0, dt >= 0, and at most 32,000,000 bounded point-steps
  • shape: time evolution
  • returns: Approx[Vec]
  • example: heat_equation([0.0, 1.0, 0.0], 0.1, 0.5, 0.01, 2, 0.0, 0.0)

wave_equation(initial, velocity, wave_speed, dx, dt, steps, left, right) -> Approx[Vec]

Section titled “wave_equation(initial, velocity, wave_speed, dx, dt, steps, left, right) -> Approx[Vec]”

Evolve the one-dimensional wave equation by a centered CFL-checked leapfrog scheme; returns an Approx final grid with a normalized discrete recurrence residual.

  • domain: one-dimensional uniform grid of 3..=4,096 finite points and matching finite velocity, fixed Dirichlet endpoints with zero endpoint velocity, finite wave_speed > 0, dx > 0, dt >= 0, CFL <= 1, and at most 32,000,000 bounded point-steps
  • shape: time evolution
  • returns: Approx[Vec]
  • example: wave_equation([0.0, 1.0, 0.0], [0.0, 0.0, 0.0], 1.0, 0.5, 0.01, 2, 0.0, 0.0)

linear_program(objective, coefficients, rhs, max_iterations?) -> LinearProgramResult

Section titled “linear_program(objective, coefficients, rhs, max_iterations?) -> LinearProgramResult”

Deterministic two-phase dense-real simplex with Bland pivots; returns Optimal, Infeasible, Unbounded, IterationLimit, or NumericalFailure plus optional incumbent and primal residual.

  • domain: finite dense real standard form max c·x subject to A x <= b and x >= 0; 1..=64 variables, 1..=128 constraints, bounded tableau and 1..=100,000 iterations
  • shape: optimization
  • returns: LinearProgramResult
  • example: linear_program([3.0, 2.0], [[1.0, 1.0], [1.0, 0.0], [0.0, 1.0]], [4.0, 2.0, 3.0])

lp(objective, coefficients, rhs, max_iterations?) -> LinearProgramResult

Section titled “lp(objective, coefficients, rhs, max_iterations?) -> LinearProgramResult”

Alias of linear_program with identical status, residual, bounds, and deterministic two-phase simplex semantics.

  • domain: alias of linear_program over the same bounded finite dense-real standard form
  • shape: optimization
  • returns: LinearProgramResult
  • example: lp([1.0], [[1.0]], [2.0])

quadratic_program(quadratic, linear, coefficients, rhs, max_active_sets?) -> OptimizationResult

Section titled “quadratic_program(quadratic, linear, coefficients, rhs, max_active_sets?) -> OptimizationResult”

Strictly-convex dense-real QP solved by bounded exhaustive active-set KKT enumeration; returns a global-convex optimum with replayable primal/stationarity residual, or an explicit non-optimal status.

  • domain: minimize 0.5 x’Qx + c’x subject to A x <= b and x >= 0; finite symmetric positive-definite Q, 1..=8 variables/constraints, and at most 100,000 exhaustively preflighted active sets
  • shape: optimization
  • returns: OptimizationResult
  • example: quadratic_program([[2.0, 0.0], [0.0, 2.0]], [-2.0, -4.0], [[1.0, 1.0], [1.0, 0.0], [0.0, 1.0]], [2.5, 2.0, 2.0])

qp(quadratic, linear, coefficients, rhs, max_active_sets?) -> OptimizationResult

Section titled “qp(quadratic, linear, coefficients, rhs, max_active_sets?) -> OptimizationResult”

Alias of quadratic_program with identical convexity, KKT enumeration, status, residual, bound, and scope semantics.

  • domain: alias of quadratic_program over the same bounded strictly-convex dense-real standard form
  • shape: optimization
  • returns: OptimizationResult
  • example: qp([[2.0]], [-4.0], [[1.0]], [3.0])

nonlinear_program(objective, initial, lower, upper, max_iterations, tolerance, method) -> OptimizationResult

Section titled “nonlinear_program(objective, initial, lower, upper, max_iterations, tolerance, method) -> OptimizationResult”

Deterministic box-projected finite-difference gradient descent with Armijo search; a converged result is explicitly local-first-order, while exhausted or stalled work is never labeled optimal.

  • domain: finite scalar callback over a 1..=32-dimensional finite box, bounded finite-difference/line-search work, max_iterations in 1..=10,000, tolerance in 1e-12..=1e-2, and final literal method projected_gradient_fd
  • shape: optimization
  • returns: OptimizationResult
  • example: nonlinear_program(optimization_objective, [0.0, 0.0], [-2.0, -2.0], [2.0, 2.0], 1000, 1e-7, "projected_gradient_fd")

nlp(objective, initial, lower, upper, max_iterations, tolerance, method) -> OptimizationResult

Section titled “nlp(objective, initial, lower, upper, max_iterations, tolerance, method) -> OptimizationResult”

Alias of nonlinear_program; preserves the explicit method, local scope, projected-gradient residual, and typed exhaustion contract.

  • domain: alias of nonlinear_program over the same bounded finite box and local-first-order method contract
  • shape: optimization
  • returns: OptimizationResult
  • example: nlp(optimization_objective, [0.0, 0.0], [-2.0, -2.0], [2.0, 2.0], 1000, 1e-7, "projected_gradient_fd")

mixed_integer_program(objective, coefficients, rhs, integer_indices, max_nodes?) -> OptimizationResult

Section titled “mixed_integer_program(objective, coefficients, rhs, integer_indices, max_nodes?) -> OptimizationResult”

Depth-first mixed-integer branch-and-bound over replay-checked Bland-pivot LP relaxations; complete search returns a global bounded optimum, node exhaustion returns an incumbent/bound/gap, and relaxation unboundedness is not promoted to an integer proof.

  • domain: maximize c’x subject to A x <= b and x >= 0 with 1..=32 sorted unique integer-variable indices; finite dense LP limits and 1..=10,000 deterministic branch nodes
  • shape: optimization
  • returns: OptimizationResult
  • example: mixed_integer_program([5.0, 4.0], [[6.0, 4.0], [1.0, 2.0], [-1.0, 1.0]], [24.0, 6.0, 1.0], [0, 1])

mip(objective, coefficients, rhs, integer_indices, max_nodes?) -> OptimizationResult

Section titled “mip(objective, coefficients, rhs, integer_indices, max_nodes?) -> OptimizationResult”

Alias of mixed_integer_program with identical branch order, LP relaxation, status, incumbent, bound, relative-gap, and work-limit semantics.

  • domain: alias of mixed_integer_program over the same bounded finite dense mixed-integer standard form
  • shape: optimization
  • returns: OptimizationResult
  • example: mip([1.0], [[1.0]], [2.5], [0])

Determinant via checked partial-pivot LU; singular matrices return numeric zero in the input domain.

  • domain: finite non-empty square dense real or complex matrix within the bounded pivoted-LU work profile
  • shape: reduction
  • returns: float | complex
  • example: det([[1.0, 2.0], [3.0, 4.0]])

solve(matrix, rhs) -> Vec[float | complex]

Section titled “solve(matrix, rhs) -> Vec[float | complex]”

Solve A x = b with checked LU, conditioning, and residual validation; any complex operand promotes the real side exactly and returns a complex vector.

  • domain: finite non-singular square dense real or complex matrix and equal-length vector; complex operands use the checked complex LU with the shared residual gate
  • shape: contraction
  • returns: Vec[float | complex]
  • example: solve([[2.0, 0.0], [0.0, 4.0]], [2.0, 8.0])

Checked dense real or complex matrix inverse with conditioning and residual validation.

  • domain: finite non-singular square dense real or complex matrix within the bounded pivoted-LU work profile
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: inv([[4.0, 7.0], [2.0, 6.0]])

qr(matrix) -> tuple[Matrix[float | complex], Matrix[float | complex]]

Section titled “qr(matrix) -> tuple[Matrix[float | complex], Matrix[float | complex]]”

Checked Householder QR returning (Q, R); complex inputs use phase-correct reflectors and conjugate orthogonality checks.

  • domain: finite non-empty dense real or complex matrix within the bounded Householder work profile
  • shape: decomposition
  • returns: tuple[Matrix[float | complex], Matrix[float | complex]]
  • example: qr([[1.0, 0.0], [0.0, 2.0]])

lu(matrix) -> tuple[Matrix[float | complex], Matrix[float | complex], list[int]]

Section titled “lu(matrix) -> tuple[Matrix[float | complex], Matrix[float | complex], list[int]]”

Checked partial-pivot LU returning (L, U, permutation) with P A = L U; real operands retain real matrices.

  • domain: finite non-empty square dense real or complex matrix within the bounded checked partial-pivot LU work profile
  • shape: decomposition
  • returns: tuple[Matrix[float | complex], Matrix[float | complex], list[int]]
  • example: lu([[2.0, 1.0], [1.0, 3.0]])

cholesky(matrix) -> Matrix[float | complex]

Section titled “cholesky(matrix) -> Matrix[float | complex]”

Lower-triangular Cholesky factor with Hermitian, positive-definite, and reconstruction checks.

  • domain: finite non-empty Hermitian positive-definite dense real or complex matrix within the bounded cubic work profile
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: cholesky([[4.0, 2.0], [2.0, 5.0]])

Checked diagonal sum preserving real or complex dtype.

  • domain: finite non-empty square dense real or complex matrix
  • shape: reduction
  • returns: float | complex
  • example: trace([[1.0, 0.0], [0.0, 2.0]])

Alias of trace with identical checked diagonal-sum semantics.

  • domain: alias of trace over the same finite non-empty square dense real or complex matrix domain
  • shape: reduction
  • returns: float | complex
  • example: tr([[1.0, 0.0], [0.0, 2.0]])

matrix_exp(matrix) -> Matrix[float | complex]

Section titled “matrix_exp(matrix) -> Matrix[float | complex]”

Principal matrix exponential with aggregate work and convergence gates.

  • domain: finite non-empty square dense real or complex matrix; bounded scaling-and-squaring Taylor profile
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: matrix_exp([[0.0, 1.0], [-1.0, 0.0]])

matrix_sqrt(matrix) -> Matrix[float | complex]

Section titled “matrix_sqrt(matrix) -> Matrix[float | complex]”

Principal matrix square root with iteration, aggregate-work, and reconstruction-residual gates.

  • domain: finite non-singular square dense real or complex matrix in the convergent bounded Denman-Beavers profile
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: matrix_sqrt([[4.0, 0.0], [0.0, 9.0]])

matrix_log(matrix) -> Matrix[float | complex]

Section titled “matrix_log(matrix) -> Matrix[float | complex]”

Principal matrix logarithm with bounded root reduction, aggregate work, and series convergence gates.

  • domain: finite non-singular square dense real or complex matrix in the bounded principal-root and atanh-series profile
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: matrix_log([[1.0, 0.0], [0.0, 2.0]])

svd(matrix) -> tuple[Matrix[float | complex], Vec[float], Matrix[float | complex]]

Section titled “svd(matrix) -> tuple[Matrix[float | complex], Vec[float], Matrix[float | complex]]”

Reduced real/complex singular-value decomposition returning (U, descending real singular values, Vh) with reconstruction and conjugate-orthogonality checks.

  • domain: finite nonempty rank-2 dense real or complex matrix; reduced outputs and bounded scale-normalized Hermitian Jacobi work
  • shape: decomposition
  • returns: tuple[Matrix[float | complex], Vec[float], Matrix[float | complex]]
  • example: svd([[3.0, 0.0], [0.0, 2.0]])

pseudoinverse(matrix) -> Matrix[float | complex]

Section titled “pseudoinverse(matrix) -> Matrix[float | complex]”

Moore-Penrose pseudoinverse derived from the checked reduced real/complex SVD with the public rank cutoff.

  • domain: finite nonempty rank-2 dense real or complex matrix; SVD cutoff s_max * max(rows, cols) * f64::EPSILON; output shape cols x rows; bounded derived work
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: pinv([[1.0, 0.0], [0.0, 2.0]])

Moore-Penrose pseudoinverse derived from the checked reduced real/complex SVD with the public rank cutoff.

  • domain: finite nonempty rank-2 dense real or complex matrix; SVD cutoff s_max * max(rows, cols) * f64::EPSILON; output shape cols x rows; bounded derived work
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: pinv([[1.0, 0.0], [0.0, 2.0]])

least_squares(matrix, rhs) -> tuple[Vec[float | complex], float, int, Vec[float]]

Section titled “least_squares(matrix, rhs) -> tuple[Vec[float | complex], float, int, Vec[float]]”

Minimum-norm real/complex SVD least-squares result as (solution, residual norm, numerical rank, singular values), with an explicit residual.

  • domain: finite nonempty rank-2 dense real or complex matrix and finite real or complex right-hand side of length rows; same SVD cutoff as rank/pinv; bounded derived work
  • shape: decomposition
  • returns: tuple[Vec[float | complex], float, int, Vec[float]]
  • example: lstsq([[1.0], [1.0]], [1.0, 2.0])

lstsq(matrix, rhs) -> tuple[Vec[float | complex], float, int, Vec[float]]

Section titled “lstsq(matrix, rhs) -> tuple[Vec[float | complex], float, int, Vec[float]]”

Minimum-norm real/complex SVD least-squares result as (solution, residual norm, numerical rank, singular values), with an explicit residual.

  • domain: finite nonempty rank-2 dense real or complex matrix and finite real or complex right-hand side of length rows; same SVD cutoff as rank/pinv; bounded derived work
  • shape: decomposition
  • returns: tuple[Vec[float | complex], float, int, Vec[float]]
  • example: lstsq([[1.0], [1.0]], [1.0, 2.0])

Spectral condition number from checked real/complex singular values; infinity explicitly represents numerical rank deficiency.

  • domain: finite nonempty rank-2 dense real or complex matrix; spectral 2-norm condition using the public SVD cutoff; numerically rank-deficient matrices return infinity
  • shape: reduction
  • returns: float
  • example: cond([[1.0, 0.0], [0.0, 2.0]])

Spectral condition number from checked real/complex singular values; infinity explicitly represents numerical rank deficiency.

  • domain: finite nonempty rank-2 dense real or complex matrix; spectral 2-norm condition using the public SVD cutoff; numerically rank-deficient matrices return infinity
  • shape: reduction
  • returns: float
  • example: cond([[1.0, 0.0], [0.0, 2.0]])

Scale-relative numerical matrix rank using the same real singular values as the checked real/complex SVD.

  • domain: finite nonempty rank-2 dense real or complex reduced-SVD domain; threshold s_max * max(rows, cols) * f64::EPSILON
  • shape: reduction
  • returns: int
  • example: rank([[1.0, 0.0], [0.0, 0.0]])

eigh(matrix) -> tuple[Vec[float], Matrix[float | complex]]

Section titled “eigh(matrix) -> tuple[Vec[float], Matrix[float | complex]]”

Symmetric/Hermitian eigendecomposition with ascending real eigenvalues, normalized eigenvectors, and reconstruction checks.

  • domain: finite Hermitian non-empty square dense real or complex matrix within the bounded real-symmetric Jacobi profile
  • shape: decomposition
  • returns: tuple[Vec[float], Matrix[float | complex]]
  • example: eigh([[2.0, 1.0], [1.0, 3.0]])

eig(matrix) -> tuple[Vec[float], Matrix[float | complex]]

Section titled “eig(matrix) -> tuple[Vec[float], Matrix[float | complex]]”

General spelling currently qualified to the symmetric/Hermitian eigendecomposition contract; nonsymmetric matrices fail typed.

  • domain: finite Hermitian non-empty square dense real or complex matrix in the same bounded checked domain as eigh
  • shape: decomposition
  • returns: tuple[Vec[float], Matrix[float | complex]]
  • example: eig([[2.0, 1.0], [1.0, 3.0]])

Ascending real eigenvalues from the checked symmetric/Hermitian eigendecomposition.

  • domain: finite Hermitian non-empty square dense real or complex matrix in the same bounded checked domain as eigh
  • shape: decomposition
  • returns: Vec
  • example: eigenvalues([[2.0, 1.0], [1.0, 3.0]])

eigenvectors(matrix) -> Matrix[float | complex]

Section titled “eigenvectors(matrix) -> Matrix[float | complex]”

Normalized eigenvector columns from the checked symmetric/Hermitian eigendecomposition.

  • domain: finite Hermitian non-empty square dense real or complex matrix in the same bounded checked domain as eigh
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: eigenvectors([[2.0, 1.0], [1.0, 3.0]])

Alias of eigenvalues over the qualified symmetric/Hermitian domain.

  • domain: same checked symmetric/Hermitian matrix domain as eigenvalues
  • shape: decomposition
  • returns: Vec
  • example: spectrum([[2.0, 1.0], [1.0, 3.0]])

Compact alias of eigenvalues over the qualified symmetric/Hermitian domain.

  • domain: same checked symmetric/Hermitian matrix domain as eigenvalues
  • shape: decomposition
  • returns: Vec
  • example: spec([[2.0, 1.0], [1.0, 3.0]])

Orthonormal column-space basis selected with the same scale-relative threshold as rank.

  • domain: finite nonempty rank-2 dense real or complex matrix in the bounded reduced-SVD domain
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: image([[1.0, 2.0], [2.0, 4.0]])

Compact alias of image.

  • domain: same checked reduced-SVD column-space domain as image
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: im([[1.0, 2.0], [2.0, 4.0]])

Orthonormal basis for the span of the supplied matrix columns.

  • domain: finite vectors supplied as columns of one nonempty rank-2 dense real or complex matrix
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: span([[1.0, 2.0], [2.0, 4.0]])

nullspace(matrix) -> Matrix[float | complex]

Section titled “nullspace(matrix) -> Matrix[float | complex]”

Orthonormal kernel basis from right singular vectors; wide matrices fail typed until a full-SVD kernel is available.

  • domain: finite nonempty square or tall dense real or complex matrix in the bounded reduced-SVD domain
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: nullspace([[1.0, 2.0], [2.0, 4.0]])

Compact alias of nullspace.

  • domain: same checked square-or-tall reduced-SVD domain as nullspace
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: ker([[1.0, 2.0], [2.0, 4.0]])

Strict matrix-matrix product over dense real or complex operands; the result dtype follows the operands.

  • domain: finite nonempty rank-2 dense real or complex matrices with agreeing inner dimensions; mixed operands promote the real side exactly; checked finite accumulation under exact element/work ceilings
  • shape: contraction
  • returns: Matrix[float | complex]
  • example: matmul([[1.0, 2.0], [3.0, 4.0]], [[1.0, 0.0], [0.0, 1.0]])

Strict matrix-vector product over dense real or complex operands; the result dtype follows the operands.

  • domain: finite nonempty rank-2 dense real or complex matrix and length-matching rank-1 vector; mixed operands promote the real side exactly; checked finite accumulation under exact work ceilings
  • shape: contraction
  • returns: Vec[float | complex]
  • example: matvec([[1.0, 0.0], [0.0, 2.0]], [3.0, 4.0])

Descriptive alias of det with identical checked pivoting, dtype, and singular-zero semantics.

  • domain: alias of det over the same checked finite real or complex square-matrix domain
  • shape: reduction
  • returns: float | complex
  • example: determinant([[1.0, 2.0], [3.0, 4.0]])

inverse(matrix) -> Matrix[float | complex]

Section titled “inverse(matrix) -> Matrix[float | complex]”

Descriptive alias of inv with identical conditioning and reconstruction gates.

  • domain: alias of inv over the same checked finite real or complex non-singular square-matrix domain
  • shape: decomposition
  • returns: Matrix[float | complex]
  • example: inverse([[4.0, 7.0], [2.0, 6.0]])

linalg.solve(matrix, rhs) -> Vec[float | complex]

Section titled “linalg.solve(matrix, rhs) -> Vec[float | complex]”

Qualified alias of solve with identical pivoting, conditioning, and residual gates.

  • domain: alias of solve over the same checked finite real or complex square system
  • shape: contraction
  • returns: Vec[float | complex]
  • example: linalg.solve([[2.0, 0.0], [0.0, 4.0]], [2.0, 8.0])

Transpose a bounded dense real matrix; rank-one vectors retain their one-dimensional representation.

  • domain: finite dense real matrix or vector under the bounded matrix-element ceiling
  • shape: decomposition
  • returns: Matrix
  • example: transpose([[1.0, 2.0], [3.0, 4.0]])

Conjugate-transpose spelling for the bounded real lane; complex adjoints remain explicitly unsupported.

  • domain: finite dense real matrix or vector; on this bounded real lane the adjoint equals the transpose
  • shape: decomposition
  • returns: Matrix
  • example: adjoint([[1.0, 2.0], [3.0, 4.0]])

Function spelling of the checked equation vector norm; omitted p selects the Euclidean norm.

  • domain: finite non-empty dense real vector and optional finite p norm supported by the equation norm kernel
  • shape: reduction
  • returns: float
  • example: norm([3.0, 4.0])

Function spelling of the bounded dense-real inner product.

  • domain: equal-length finite dense real vectors under the bounded vector-element ceiling
  • shape: reduction
  • returns: float
  • example: inner([1.0, 2.0], [3.0, 4.0])

Bounded dense-real outer product.

  • domain: finite dense real vectors whose output shape and multiplication work fit the matrix ceilings
  • shape: constructor
  • returns: Matrix
  • example: outer([1.0, 2.0], [3.0, 4.0])

Function spelling of the bounded dense-real Kronecker product.

  • domain: finite dense real matrices whose Kronecker shape and multiplication work fit the matrix ceilings
  • shape: constructor
  • returns: Matrix
  • example: kron([[1.0, 2.0]], [[3.0], [4.0]])

Function spelling of the bounded dense-real elementwise matrix product.

  • domain: equal-shape finite dense real matrices under the bounded matrix-element ceiling
  • shape: elementwise (binary broadcast)
  • returns: Matrix
  • example: hadamard([[1.0, 2.0]], [[3.0, 4.0]])

sparse(rows, cols, row_indices, col_indices, values) -> SparseMatrix

Section titled “sparse(rows, cols, row_indices, col_indices, values) -> SparseMatrix”

Validated CSR construction from COO triplets; duplicates are a typed ShapeError, never silently summed. Exits equations as a tagged inspectable record.

  • domain: COO triplets over a nonempty shape: in-bounds indices, finite f64 values, no duplicate coordinates, and exact shape/nnz ceilings; canonicalized to sorted CSR
  • shape: constructor
  • returns: SparseMatrix
  • example: sparse(2, 2, [0, 1], [0, 1], [1.0, 2.0])

sparse.matmul(matrix, operand) -> SparseMatrix | Vec | Matrix

Section titled “sparse.matmul(matrix, operand) -> SparseMatrix | Vec | Matrix”

Checked sparse or sparse-dense product; sparse right operands preserve CSR storage.

  • domain: CSR times CSR, a dense real vector, or a dense real matrix under exact work, fill-in, and result-size ceilings; sparse products preserve canonical CSR
  • shape: contraction
  • returns: SparseMatrix | Vec | Matrix
  • example: sparse.matmul(sparse(2, 2, [0, 1], [0, 1], [1.0, 2.0]), [3.0, 4.0])

Solve sparse A x = b through bounded sparse LU without densification.

  • domain: square CSR system solved through pivoted sparse LU under explicit work and factor fill-in ceilings, with finite arithmetic and a backward-residual gate
  • shape: contraction
  • returns: Vec
  • example: sparse.solve(sparse(2, 2, [0, 1], [0, 1], [2.0, 4.0]), [2.0, 8.0])

Transpose a sparse matrix while preserving canonical CSR storage.

  • domain: canonical CSR matrix under the public shape and nnz ceilings
  • shape: decomposition
  • returns: SparseMatrix
  • example: sparse.transpose(sparse(2, 3, [0, 1], [1, 2], [1.0, 2.0]))

Bounded sparse normal-equation least squares with typed rank-deficiency.

  • domain: finite real CSR matrix and length-matching dense real right-hand side; normal equations, products, and solve remain sparse under work/fill ceilings
  • shape: contraction
  • returns: Vec
  • example: sparse.lstsq(sparse(3, 2, [0, 1, 2], [0, 1, 1], [1.0, 1.0, 1.0]), [1.0, 2.0, 2.0])

sparse.lu(matrix) -> tuple[SparseMatrix, SparseMatrix, list[int]]

Section titled “sparse.lu(matrix) -> tuple[SparseMatrix, SparseMatrix, list[int]]”

Pivoted sparse LU returning canonical CSR L and U plus the row permutation.

  • domain: square finite real CSR matrix under explicit pivot-search, elimination-work, and factor-fill ceilings
  • shape: decomposition
  • returns: tuple[SparseMatrix, SparseMatrix, list[int]]
  • example: sparse.lu(sparse(2, 2, [0, 0, 1], [0, 1, 1], [2.0, 1.0, 3.0]))

sparse.eigs(matrix) -> tuple[float, Vec, float, int, bool]

Section titled “sparse.eigs(matrix) -> tuple[float, Vec, float, int, bool]”

Dominant-magnitude sparse eigenpair with explicit residual, iteration count, and convergence flag.

  • domain: square finite real CSR matrix; bounded power iteration (1000 iterations, 1e-10 residual tolerance)
  • shape: decomposition
  • returns: tuple[float, Vec, float, int, bool]
  • example: sparse.eigs(sparse(2, 2, [0, 1], [0, 1], [3.0, 1.0]))

Forward-mode Jacobian-vector product without materializing the Jacobian; variables are ordered lexicographically.

  • domain: scalar or flat vector target over >=1 sorted free real scalar variable; one-dimensional finite real tangent of exactly matching length (bounded forward work)
  • shape: differential
  • returns: float | Vec
  • example: jvp([x^2, x * y], [1.0, -0.5])

Vector-Jacobian product. The bounded reference lane contracts the exact forward-dual Jacobian and does not allocate an unbounded reverse tape.

  • domain: scalar or flat-vector result over a user function’s first real scalar/flat-vector argument, or sorted free real scalar variables; finite one-dimensional cotangent with exactly one lane per result (bounded dual-Jacobian contraction)
  • shape: differential
  • returns: float | Vec
  • example: vjp([x^2, x * y], [0.5, -1.0])

Returns complex [∂f/∂z, ∂f/∂z̄]; a zero second lane is the explicit holomorphic criterion.

  • domain: two real outputs [u,v] over exactly two real coordinates [x,y], interpreted as f(x+iy)=u+iv; finite differentiable path
  • shape: differential
  • returns: Vec[float | complex]
  • example: wirtinger([x^2 - y^2, 2*x*y])

Jacobian matrix ∂f_i/∂x_j via forward-mode dual numbers.

  • domain: vector-valued expression over free scalar variables (bounded seed/work)
  • shape: differential
  • returns: Matrix
  • example: jacobian([x^2, x * y])

Hessian matrix via central differences of the exact dual gradient.

  • domain: scalar expression with >= 1 free variable (bounded cubic work)
  • shape: differential
  • returns: Matrix
  • example: hessian(x^2 + y^2)