Endurance enhancement programming method for 50nm resistive random access memory (ReRAM)