public static double[] speed(double[] origin, long[] time) {
    int n = origin.length;
    double[] speed = new double[n - 1];
    for (int i = 0; i < n - 1; i++) {
      speed[i] = (origin[i + 1] - origin[i]) / (time[i + 1] - time[i]);
    }
    return speed;
  }
calculate speed (1-order derivative with backward difference).

@param origin value series
@param time timestamp series
@return speed series
library-udf/src/main/java/org/apache/iotdb/library/util/Util.java