Simulation and Optimization of Digital Circuits: Considering and Mitigating Destabilizing Factors