let in_range hist x = let cmp_lo = hist.cmp x (minimum hist) in let cmp_hi = hist.cmp x (maximum hist) in (cmp_lo = 1 || cmp_lo = 0) && (cmp_hi = -1)