code: private static Double eaDistance(double[] series, int a, int b, Integer motifSize, double range,
        double znormThreshold) {
  
      distCounter++;
  
      double cutOff2 = range * range;
  
      double[] seriesA = tp.znorm(tp.subseriesByCopy(series, a, a + motifSize), znormThreshold);
      double[] seriesB = tp.znorm(tp.subseriesByCopy(series, b, b + motifSize), znormThreshold);
  
      Double res = 0D;
      for (int i = 0; i < motifSize; i++) {
        res = res + distance2(seriesA[i], seriesB[i]);
        if (res > cutOff2) {
          eaCounter++;
          return Double.NaN;
        }
      }
      return Math.sqrt(res);
  
    }
docs: Early abandoning distance configure by range.
  
  @param series the series to use.
  @param a the position of subseries a.
  @param b the position of subseries b.
  @param motifSize the motif length.
  @param range the range value.
  @param znormThreshold z-normalization threshold.
  @return a distance value or NAN if above the threshold.