code: public static void reverse(double[] array, int fromIndex, int toIndex) {
      checkNotNull(array);
      checkPositionIndexes(fromIndex, toIndex, array.length);
      for (int i = fromIndex, j = toIndex - 1; i < j; i++, j--) {
        double tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
      }
    }
docs: Reverses the elements of {@code array} between {@code fromIndex} inclusive and {@code toIndex}
  exclusive. This is equivalent to {@code
  Collections.reverse(Doubles.asList(array).subList(fromIndex, toIndex))}, but is likely to be
  more efficient.
  
  @throws IndexOutOfBoundsException if {@code fromIndex < 0}, {@code toIndex > array.length}, or
  {@code toIndex > fromIndex}
  @since 23.1