sorry i left a bracket of each line...

if ((X == X) && (Y == Y)) { echo result1 $ifmatch }
if ((X == X) || (Y == Y)) { echo result2 $ifmatch }