gradient for denominator of second order correlation optimization