Skip to main content

Compare backends at a stated precision

Shared polynomial coefficients provide a mathematical common source. Floating-point results also depend on dtype, operation ordering, compiler transformations, device, and the selected algorithm.

Set up a useful comparison​

  1. Use the same activation, derivative order, shapes, and input values.
  2. Enable JAX float64 before array construction with JAX_ENABLE_X64=1 when comparing float64 results.
  3. Match the Torch dtype explicitly. Keep model parameters and inputs consistent.
  4. Select the same mathematical path; a directional estimator and exact support enumeration are different algorithms.
  5. Compare absolute and relative errors against a suitable independent reference, and include difficult inputs.

Riccati and general-composition paths can have different accumulation order. Algebraic equivalence is not a promise of bit identity. Report the actual tolerance and inputs of a passing comparison.

The benchmark methodology separates numerical accuracy from speed. Numerical scope describes supported operator paths.