public static double[] copyOfRange(double[] original,int start,int end){
  if (start <= end) {
    if (original.length >= start && 0 <= start) {
      int length=end - start;
      int copyLength=Math.min(length,original.length - start);
      double[] copy=new double[length];
      System.arraycopy(original,start,copy,0,copyLength);
      return copy;
    }
    throw new ArrayIndexOutOfBoundsException();
  }
  throw new IllegalArgumentException();
}

public static double [ ] copyOfRange ( double [ ] original , int start , int end ) { if ( start <= end ) { if ( original . length >= start && 0 <= start ) { int length = end - start ; int copyLength = Math . min ( length , original . length - start ) ; double [ ] copy = new double [ length ] ; System . arraycopy ( original , start , copy , 0 , copyLength ) ; return copy ; } throw new ArrayIndexOutOfBoundsException ( ) ; } throw new IllegalArgumentException ( ) ; }
copies elements in original array to a new array , from index start ( inclusive ) to end ( exclusive ) . the first element ( if any ) in the new array is original [ from ] , and other elements in the new array are in the original order . the padding value whose index is bigger than or equal to original . length - start is 0d .
