Skip to main content

Module validation

Module validation 

Source
Expand description

Canonical numerical error metrics shared across solver tests and benches.

This module is the single place where numerical-versus-reference error is measured. It defines a normalized relative error and a tolerance check so every benchmark and integration test reports accuracy on the same scale.

The metric is deliberately scale-free: dividing by the reference magnitude makes a $0.1%$ tolerance mean the same thing whether the reference is a portfolio value of order $1$ or an inventory spread of order $0.1$. An absolute floor prevents division by zero for references at or near zero, where a relative error is undefined.

Constants§

DEFAULT_ABS_FLOOR
Smallest reference magnitude considered non-degenerate.

Functions§

assert_close
Asserts that numerical matches reference within an absolute or relative tolerance.
assert_within
Asserts that numerical is within tolerance relative error of reference.
percent_error
Percentage relative error.
relative_error
Normalized relative error between a numerical value and a reference.
relative_error_with_floor
Normalized relative error with an explicit absolute floor.