def find_index_unsafe(val, bin_edges):
    """Find bin index of `val` within binning defined by `bin_edges`.

    Validity of `val` and `bin_edges` is not checked.

    Parameters
    ----------
    val : scalar
        Assumed to be within range of `bin_edges` (including lower and upper
        bin edges)
    bin_edges : array

    Returns
    -------
    index

    See also
    --------
    find_index : includes bounds checking and handling of special cases

    """
    # Initialize to point to left-most edge
    left_edge_idx = 0

    # Initialize to point to right-most edge
    right_edge_idx = len(bin_edges) - 1

    while left_edge_idx < right_edge_idx:
        # See where value falls w.r.t. an edge ~midway between left and right edges
        # ``>> 1``: integer division by 2 (i.e., divide w/ truncation)
        test_edge_idx = (left_edge_idx + right_edge_idx) >> 1

        # ``>=``: bin left edges are inclusive
        if val >= bin_edges[test_edge_idx]:
            left_edge_idx = test_edge_idx + 1
        else:
            right_edge_idx = test_edge_idx

    # break condition of while loop is that left_edge_idx points to the
    # right edge of the bin that `val` is inside of; that is one more than
    # that _bin's_ index
    return left_edge_idx - 1