code: private void computeGradientAndHessian(DMatrixRMaj param  )
      {
          // residuals = f(x) - y
          function.compute(param, residuals);
  
          computeNumericalJacobian(param,jacobian);
  
          CommonOps_DDRM.multTransA(jacobian, residuals, g);
          CommonOps_DDRM.multTransA(jacobian, jacobian,  H);
  
          CommonOps_DDRM.extractDiag(H,Hdiag);
      }
docs: Computes the d and H parameters.
  
  d = J'*(f(x)-y)    <--- that's also the gradient
  H = J'*J