feynlag.verify.checks.numeric_equal¶
- feynlag.verify.checks.numeric_equal(expr_a, expr_b, symbols, n_points=20, tol=1e-10, sample_range=(0.1, 10.0), seed=None)[source]¶
Random-point NUMERIC equality of two expressions.
Defense against the canonical-form problem: physically identical expressions can differ syntactically and defeat
simplify. Evaluates both atn_pointsrandom points and compares with relative tolerance. Complements (never replaces) the symbolic check.- Returns:
(ok: bool, max_observed_relative_diff).
Note: samples positive reals by default; adjust
sample_rangefor expressions with singularities.