def METHOD_NAME(
    s21: list[Datapoint], idx_1: int, idx_2: int
) -> tuple[float, float]:
    if idx_1 == idx_2:
        return (math.nan, math.nan)
    freq_1, freq_2 = s21[idx_1].freq, s21[idx_2].freq
    gain_1, gain_2 = s21[idx_1].gain, s21[idx_2].gain
    factor = freq_1 / freq_2 if freq_1 > freq_2 else freq_2 / freq_1
    attn = abs(gain_1 - gain_2)
    decade_attn = attn / math.log10(factor)
    octave_attn = decade_attn * math.log10(2)
    return (octave_attn, decade_attn)