A Fast Algorithm to Simulate Nonlinear Resistive Networks