math-deriv-numerical-check
The groupant beside math/src/deriv.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 |
| 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 |
sampling_coordinates | sampling_coordinates | partial source derived model | sampling_coordinates |
metric_zero | metric_zero | partial source derived model | metric_zero |
availability_filter | availability_filter | partial source derived model | availability_filter |
assurance_limit | assurance_limit | partial source derived model | assurance_limit |
Model text
descriptant
math-deriv-numerical-check
check_derivative substitutes eight fixed coordinates, central h=1e-5 max(|p|,1). Unsupported/nonfinite skip, >=3 with scaled discrepancy<=1e-5 accepts. Passing is finite agreement, not global identity or nonsingularity; use parent calc approximation subset.
Epoch 2026-10-31: complete source read, parent AST reused; partial finite evidence only.
approximant
Scoped forward and cost
check_derivative substitutes eight fixed coordinates, central h=1e-5 max(|p|,1). Unsupported/nonfinite skip, >=3 with scaled discrepancy<=1e-5 accepts. Passing is finite agreement, not global identity or nonsingularity; use parent calc approximation subset.
No executable percent surrogate claimed.
invariant
Scoped invariant
check_derivative substitutes eight fixed coordinates, central h=1e-5 max(|p|,1). Unsupported/nonfinite skip, >=3 with scaled discrepancy<=1e-5 accepts. Passing is finite agreement, not global identity or nonsingularity; use parent calc approximation subset.
Source range[6714,8091) bound by manifest digest. Parent domain applies, not arbitrary public states.
models
Source-scoped typed relations
behavior_complement
Fewer than3 finite usable samples excludes ok=true; any used discrepancy>1e-5 also excludes success. Skipped samples do not contribute false evidence of equality.
reverse_reconstruction
A passing check admits all f,df agreeing to tolerance at reached fixed sample neighborhoods. Functions differing elsewhere or vanishing perturbations at samples share the observation; no unique derivative recovery.
sampling_coordinates
Points are0.3,0.7,1.1,1.9,2.6,-0.4,-1.3,3.7. At each p choose h=1e-5*max(|p|,1); evaluate f(p+h),f(p-h),df(p) in cloned envs with target replaced by V::R.
metric_zero
num=(a-b)/(2h), err=|num-dv|/max(|dv|,1). Near zero derivative this is absolute scale1, not relative division by zero. Worst records maximum over used samples.
availability_filter
Missing calc::approx formula or any nonfinite a,b,dv skips sample. Unsupported unknown-call functions can yield0 usable samples even when symbolic derive returns0 by target absence.
assurance_limit
Finite differences include cancellation/truncation and float error. Eight fixed coordinates cannot prove symbolic identity or nonsingularity elsewhere; threshold is a diagnostic, not1/2/5/10% executable surrogate assurance.
tests
Evidence
See ../tests.md for actual checks and source mutant; this fragment adds no runtime test.
check_derivative substitutes eight fixed coordinates, central h=1e-5 max(|p|,1). Unsupported/nonfinite skip, >=3 with scaled discrepancy<=1e-5 accepts. Passing is finite agreement, not global identity or nonsingularity; use parent calc approximation subset.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/math/src/deriv.rs.groupant/numerical-check.groupant/