docs: @SuppressWarnings("unused")
    private ApproximationLine approximateUpperHullOld(ConvexHull convexHull, double[] log_k, double sum_log_k, double sum_log_k2, double[] log_kDist, double sum_log_kDist, double sum_log_k_kDist) {
      StringBuilder msg = new StringBuilder(10000);
      int[] upperHull = convexHull.getUpperHull();
      int u = convexHull.getNumberOfPointsInUpperHull();
      int k_0 = settings.kmax - upperHull.length + 1;
  
      // linear search on all line segments on the upper convex hull
      msg.append("upper hull:").append(u);
      double upp_error = Double.MAX_VALUE;
      double upp_m = 0.0;
      double upp_t = 0.0;
      for(int i = 1; i < u; i++) {
        double cur_m = (log_kDist[upperHull[i]] - log_kDist[upperHull[i - 1]]) / (log_k[upperHull[i]] - log_k[upperHull[i - 1]]);
        double cur_t = log_kDist[upperHull[i]] - cur_m * log_k[upperHull[i]];
        double cur_error = ssqerr(k_0, settings.kmax, log_k, log_kDist, cur_m, cur_t);
        if(cur_error < upp_error) {
          upp_error = cur_error;
          upp_m = cur_m;
          upp_t = cur_t;
        }
      }
      // linear search on all points of the upper convex hull
      boolean is_left = true; // NEEDED FOR PROOF CHECK
      for(int i = 0; i < u; i++) {
        double cur_m = optimize(k_0, settings.kmax, sum_log_k, sum_log_k2, log_k[upperHull[i]], log_kDist[upperHull[i]], sum_log_k_kDist, sum_log_kDist);
        double cur_t = log_kDist[upperHull[i]] - cur_m * log_k[upperHull[i]];
        // only valid if both neighboring points are underneath y=mx+t
        if((i == 0 || log_kDist[upperHull[i - 1]] <= log_kDist[upperHull[i]] - cur_m * (log_k[upperHull[i]] - log_k[upperHull[i - 1]])) && (i == u - 1 || log_kDist[upperHull[i + 1]] <= log_kDist[upperHull[i]] + cur_m * (log_k[upperHull[i + 1]] - log_k[upperHull[i]]))) {
          double cur_error = ssqerr(k_0, settings.kmax, log_k, log_kDist, cur_m, cur_t);
          if(cur_error < upp_error) {
            upp_error = cur_error;
            upp_m = cur_m;
            upp_t = cur_t;
          }
        }
  
        // check proof of bisection search
        if(!(i > 0 && log_kDist[upperHull[i - 1]] > log_kDist[upperHull[i]] - cur_m * (log_k[upperHull[i]] - log_k[upperHull[i - 1]])) && !is_left) {
          LOG.warning("ERROR upper: The bisection search will not work properly !" + "\n" + FormatUtil.format(log_kDist));
        }
        if(!(i < u - 1 && log_kDist[upperHull[i + 1]] > log_kDist[upperHull[i]] + cur_m * (log_k[upperHull[i + 1]] - log_k[upperHull[i]]))) {
          is_left = false;
        }
      }
      return new ApproximationLine(k_0, upp_m, upp_t);
    }