public Expression simplify() {
		if (subExpressions[0] instanceof CompareToIntOperator) {

			CompareToIntOperator cmpOp = (CompareToIntOperator) subExpressions[0];

			boolean negated = false;
			int opIndex = getOperatorIndex();
			if (cmpOp.allowsNaN && getOperatorIndex() > NOTEQUALS_OP) {
				if (cmpOp.greaterOnNaN == (opIndex == GREATEREQ_OP || opIndex == GREATER_OP)) {
					negated = true;
					opIndex ^= 1;
				}
			}
			Expression newOp = new CompareBinaryOperator(cmpOp.compareType,
					opIndex, cmpOp.allowsNaN).addOperand(
					cmpOp.subExpressions[1])
					.addOperand(cmpOp.subExpressions[0]);

			if (negated)
				return newOp.negate().simplify();
			return newOp.simplify();
		}
		if (subExpressions[0].getType().isOfType(Type.tBoolean)) {
			/* xx == false */
			if (getOperatorIndex() == EQUALS_OP)
				return subExpressions[0].negate().simplify();
			/* xx != false */
			if (getOperatorIndex() == NOTEQUALS_OP)
				return subExpressions[0].simplify();
		}
		return super.simplify();
	}