code: public static double sum(final double[] data, final int startInclusive, final int endExclusive) {
      checkArgument(startInclusive >= 0);
      checkArgument(endExclusive <= data.length);
      checkArgument(endExclusive >= startInclusive);
  
      double ret = 0.0;
      for (int i = startInclusive; i < endExclusive; ++i) {
        ret += data[i];
      }
      return ret;
    }
docs: Sum over the doubles at the given indices of {@code data}