public double reachDist(Double[] o, Double[] x, Double[] nnk) {
    return Math.max(dist(o, x), dist(nnk, x));
  }
This function is used to detect density anomaly of time series.
library-udf/src/main/java/org/apache/iotdb/library/anomaly/UDTFLOF.java