The test is the opposite of (X ends before Y starts) and (Y ends before X starts). You only need two comparisons.
With two events, X going from xb to xe, and Y going from yb to ye, you have these possible sequences:
xb xe yb ye (no conflict)
xb yb xe ye (conflict)
xb yb ye xe (conflict)
yb ye xb xe (no conflict)
yb xb ye xe (conflict)
yb xb xe ye (conflict)
As long as (xb >= ye or yb >= xe) there's no conflict. You can flip those: (xb < ye and yb < xe) to get the conflict condition.We can evaluate this expression over those cases:
xb xe yb ye : yb < xe => false => no conflict
xb yb xe ye : xb < ye and yb < xe => true, conflict
xb yb ye xe : xb < ye and yb < xe => true, conflict
yb ye xb xe : xb < ye => false => no conflict
yb xb ye xe : xb < ye and yb < xe => true, conflict
yb xb xe ye : xb < ye and yb < xe => true, conflict
So you only need two comparisons, and an and operation.