Simplifying undefined comparisons