|
| 1 | +# Menudet draft: numeric certification |
| 2 | + |
| 3 | +Menudet requires checked integer results and the stated floating-point type, |
| 4 | +domain, NaN, infinity, signed-zero and rounding rules. It does **not** promise |
| 5 | +bit-identical transcendental results across host math libraries or a universal |
| 6 | +ULP error bound. Native exact-anchor and exceptional-value tests remain separate |
| 7 | +from the bounded independent math check described here. |
| 8 | + |
| 9 | +## Reproducible independent references |
| 10 | + |
| 11 | +`scripts/menudet_math_vectors.json` contains 284 samples for 40 canonical |
| 12 | +operations, covering both float32 and float64. Inputs and expected results are |
| 13 | +stored as exact hexadecimal encodings. References were generated with mpmath |
| 14 | +1.3.0 at both 100 and 200 decimal digits; regeneration rejects disagreement |
| 15 | +between the two rounded results. The checker does not need mpmath and does not |
| 16 | +use NumPy or the executing host's libm as its mathematical reference. |
| 17 | + |
| 18 | +The finite domains include inverse-function endpoints, small arguments that |
| 19 | +exercise cancellation, mixed quadrants, gamma functions, and explicit fused |
| 20 | +multiply-add cancellation. Domain errors, NaNs/infinities, subnormal behavior, |
| 21 | +signed zeros, rounding functions, nextafter and aliases additionally have native |
| 22 | +conformance fixtures; they are not certified merely by these finite samples. |
| 23 | + |
| 24 | +| Operations | Maximum error for the checked samples | |
| 25 | +| --- | --- | |
| 26 | +| cospi, sinpi, exp10, lgamma, tgamma, logaddexp | 8 ULP | |
| 27 | +| Other sampled transcendental functions, sqrt, hypot, floating pow | 4 ULP | |
| 28 | +| fdim, fmin, fmax, copysign, fmod, remainder, ldexp, fma | Exact rounded value | |
| 29 | + |
| 30 | +These are **function-specific acceptance budgets for this finite corpus**, not |
| 31 | +new normative bounds over all possible inputs. ULP is measured using the smaller |
| 32 | +adjacent gap at the expected value, including at powers of two. Adding a new |
| 33 | +sample or changing a budget requires review; a failed platform must not silently |
| 34 | +skip a function or inflate its tolerance. |
| 35 | + |
| 36 | +## Running certification |
| 37 | + |
| 38 | +Against an installed package: |
| 39 | + |
| 40 | +```console |
| 41 | +python scripts/certify_menudet_math.py --report menudet-math.json |
| 42 | +``` |
| 43 | + |
| 44 | +Reports identify the package path/version, platform, reference generator, sample |
| 45 | +count, per-function/per-precision maxima and individual failures. The process |
| 46 | +exits nonzero on failure. Use `--generate` only to regenerate the checked-in |
| 47 | +reference corpus in a development environment with mpmath installed. |
| 48 | + |
| 49 | +Native Python CI uploads the reports. The same corpus runs in Pyodide and in the |
| 50 | +installed-wheel test command, without adding a runtime reference-library |
| 51 | +dependency. Passing a local wheel certifies only that tested wheel and host; |
| 52 | +release readiness additionally requires the supported platform matrix to pass. |
0 commit comments