code: @Override
      public double defuzzify(Term term, double minimum, double maximum) {
          if (!Op.isFinite(minimum + maximum)) {
              return Double.NaN;
          }
          final double dx = (maximum - minimum) / getResolution();
          int counter = getResolution();
          int left = 0, right = 0;
          double leftArea = 0, rightArea = 0;
          double xLeft = minimum, xRight = maximum;
          while (counter-- > 0) {
              if (Op.isLE(leftArea, rightArea)) {
                  xLeft = minimum + (left + 0.5) * dx;
                  leftArea += term.membership(xLeft);
                  left++;
              } else {
                  xRight = maximum - (right + 0.5) * dx;
                  rightArea += term.membership(xRight);
                  right++;
              }
          }
          //Inverse weighted average to compensate
          return (leftArea * xRight + rightArea * xLeft) / (leftArea + rightArea);
      }
docs: Computes the bisector of a fuzzy set. The defuzzification process
  integrates over the fuzzy set utilizing the boundaries given as parameters.
  The integration algorithm is the midpoint rectangle method
  (https://en.wikipedia.org/wiki/Rectangle_method).
  
  @param term is the fuzzy set
  @param minimum is the minimum value of the fuzzy set
  @param maximum is the maximum value of the fuzzy set
  @return the `x`-coordinate of the bisector of the fuzzy set