code: protected static double[] smooth(List<double[]> toSmooth){
      double[] smoothed = new double[toSmooth.get(0).length];
  
      for(double[] thisArray:toSmooth){
        ArrayMath.pairwiseAddInPlace(smoothed,thisArray);
      }
  
      ArrayMath.multiplyInPlace(smoothed,1/((double) toSmooth.size() ));
      return smoothed;
    }
docs: /*
  This is used to smooth the gradients, providing a more robust calculation which
  generally leads to a better routine.