Add R_OPTIM6 that add a binary sort on x, when the cardinality condition is not enough. Proven correct by zecloche