Optimization of a phase change memories simulator using improved numerical methods .