cor optimization for no NA/NaN case