def METHOD_NAME(x: dace.float64, bin_edges: dace.float64[bins + 1]):
    # assuming uniform bins for now
    a_min = bin_edges[0]
    a_max = bin_edges[bins]
    return dace.int64(bins * (x - a_min) / (a_max - a_min))