mlab-numerics-elem-gamma
The groupant beside mlab/src/builtins/elem.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.
Facts
Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.
Components
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | ../syntax.json |
| cost | symbolic source derived | invariant |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| tests | executed bounded checks | tests |
Obernants
The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
pole_boundary | pole_boundary | partial source derived model | pole_boundary |
positive_factorial | positive_factorial | partial source derived model | positive_factorial |
nan_branch | nan_branch | partial source derived model | nan_branch |
library_dependency | library_dependency | partial source derived model | library_dependency |
Model text
descriptant
mlab-numerics-elem-gamma
gamma(x) returns Inf when x==trunc(x) and x<=0; otherwise returns libm::tgamma(x).
Modeling epoch 2026-10-31
Prospective source reading preceded inline tests. This node records implementation behavior, not a complete MATLAB compatibility contract. Models retain limits discovered in source reading, including real-only projections and warning-only result gates. Synthetic CPU fixtures are independent of frozen suites. No external effects, teacher, corpora or benchmark main are executed.
approximant
Forward relation
gamma(x) returns Inf when x==trunc(x) and x<=0; otherwise returns libm::tgamma(x).
Executable Rust surrogate gap: no calibrated replacement is attached. Exact test calls are evidence for the reference, not a fast approximant. Numerical approximants would need a named domain, zero convention and metric at supported caps 1/2/5/10%; categorical errors/effects have no percent surrogate here.
invariant
Invariants and cost
Exact pole policy precedes library evaluation; no rejection Result.
Cost
Constant wrapper work plus libm implementation.
Allocation failure, unchecked usize dimension arithmetic and IEEE nonfinite propagation are outside finite fixture guarantees. No measured throughput or global accuracy claim.
models
Typed source models: mlab-numerics-elem-gamma
behavior_complement
Nonpositive integer poles exclude a finite result. No reflected approximation is implemented here.
reverse_reconstruction
All nonpositive integers belong to the positive-Inf output fiber, along with possible overflow inputs; a gamma value generally has multiple real antecedents.
pole_boundary
gamma(-2)=Inf and gamma(0)=Inf.
positive_factorial
For fixture x=5, gamma=4!=24; this does not certify every integer.
nan_branch
NaN fails equality and reaches libm; no custom NaN error.
library_dependency
Accuracy outside poles is delegated to libm; no Boost held-out suite executed.
tests
Evidence and limits
Selected wave30_tests exercise this source; fragment-specific limits are stated in its operators.
Native command specifications, numeric exits, profile-paired logs, compiled controls and exact-restoration receipts are retained externally in the wave30 numerics run. Tests exercise actual source, not a copied model. The selected finite fixtures do not prove full convergence, backend accuracy on all matrices, resource exhaustion or side-effectful callback behavior.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/elem.rs.groupant/elem-gamma.groupant/