An efficient method for the computation of second-order network sensitivity functions