compare_numeric
elegua.compare_numeric
¶
L4 numeric comparison — sample-point agreement within tolerance.
Factory function that creates a LayerFn closure capturing tolerance and minimum sample count configuration. Register the returned function as Layer 4 in a ComparisonPipeline.
make_numeric_comparator(tol=1e-06, min_samples=1)
¶
Create an L4 numeric comparison function.
The returned function compares numeric_samples from both tokens:
matching sample points (by variable values) must agree within tol.
Returns MATH_MISMATCH if fewer than min_samples common points exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tol
|
float
|
Absolute tolerance for value comparison. |
1e-06
|
min_samples
|
int
|
Minimum number of common sample points required. |
1
|