histogram
std.stats.histogram · Level L3Counts per bin for increasing bin edges, with NumPy's rules: half-open bins, the last one closed, values outside the edges not counted. Each value's bin comes from comparisons, becomes an integer slot with Cast, and is counted with ScatterAdd.
Signature
histogram(x: f64[n], edges: f64[m]) → f64[m−1]
Requires: m ≥ 2
Structure
The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size with m ≥ 2.
- Equal to the reference
np.histogram(x, edges)[0]in exact rational arithmetic, on all 40 test cases. - All 134 float64 results are exact: the error is zero.
- Interpreter and NumPy backend return bit-identical results.
- correctly rounded (the float64 nearest the exact value)
- 100%
- bit-equal to the NumPy formula in float64
- 87%
- largest error, in units in the last place
- 0
Note
Slot 0 collects values below the first edge and slot m values above the last; both are sliced away. A value equal to the last edge moves down one slot, into the closed last bin.
Identity
sha256:db7302996d18bbe30c61607e1186a2594edd8752a3fa3fda74a26871a812d9faThe semantic hash of the graph. It changes when the program changes, and never when only its documentation does.