NOTE [wasm.md C3]: the default epsilon = 1e-6 is appropriate for typical
Float32 single-step operations. For multi-step algorithms that accumulate
rounding error per dimension (e.g. mahalanobis_distance does ndim
forward-substitution steps), call sites should pass a scaled epsilon —
e.g. arraysAlmostEqual(a, b, 1e-5 * Math.sqrt(ndim)) for ndim > 3 —
to avoid silently missing WASM-vs-TS divergence at high dimensions.
Compare two float arrays within a tolerance.
NOTE [wasm.md C3]: the default
epsilon = 1e-6is appropriate for typical Float32 single-step operations. For multi-step algorithms that accumulate rounding error per dimension (e.g.mahalanobis_distancedoes ndim forward-substitution steps), call sites should pass a scaled epsilon — e.g.arraysAlmostEqual(a, b, 1e-5 * Math.sqrt(ndim))for ndim > 3 — to avoid silently missing WASM-vs-TS divergence at high dimensions.