static double[] diffsBetweenDoubles(double[] l) { int n = l(l); if (n < 2) ret emptyDoubleArray(); double[] diffs = new[n-1]; for (int i = 1; i < n; i++) diffs[i-1] = l[i]-l[i-1]; ret diffs; }