code: public double cost( DenseMatrix64F param , DenseMatrix64F X , DenseMatrix64F Y)
      {
          func.compute(param,X, temp0);
  
          double error = diffNormF(temp0,Y);
  
          return error*error / (double)X.numRows;
      }
docs: Computes the "cost" for the parameters given.
  
  cost = (1/N) Sum (f(x;p) - y)^2