def gate_error_to_irb_decay(irb_error: float, rb_decay: float, dim: int):
    """
    For convenience, inversion of Eq. 4 of [IRB]_.

    See :func:`irb_decay_to_error`.

    :param irb_error: error of the interleaved gate.
    :param rb_decay: Observed decay parameter in standard rb experiment.
    :param dim: Dimension of the Hilbert space, 2**num_qubits
    :return: Decay parameter in irb experiment with relevant gate interleaved between Cliffords
    """
    return (1 - irb_error * (dim / (dim - 1))) * rb_decay