Tolerance #
Approximation tolerances (absolute + relative).
This file defines a small, reusable tolerance object for "close enough" reasoning:
- absolute tolerance (units of the quantity),
- relative tolerance (dimensionless), and
- a nonnegative slack factor to scale the budget.
It is intentionally lightweight and independent of any specific backend (IBP/FP32/etc.).
PyTorch correspondence / citations #
PyTorch (and NumPy) commonly expose absolute + relative tolerances (often called atol/rtol)
in APIs like torch.allclose / torch.testing.assert_allclose. Our approxBound follows the same
pattern, but uses max |x| |y| as the relative scale so the bound is symmetric in x and y.
https://pytorch.org/docs/stable/generated/torch.allclose.html
https://pytorch.org/docs/stable/testing.html
Build a tolerance from reals, clamping negatives to 0 via Real.toNNReal.
Instances For
Default slack = 1.
Instances For
Absolute-only tolerance (relative = 0, slack = 1).
Instances For
Scalar abs+rel error budget using max |x| |y| as the scale.
Instances For
Scalar approximation under an abs+rel tolerance.