code: public double overlapRelative(DoubleRange other) {
      double lenThis = length();
      double lenOther = other.length();
      if (lenThis == 0 && lenOther == 0) {
        // check for single points being compared, if it's the same point overlap is 1
        // if points are different, overlap is 0
        return this.equals(other) ? 1 : 0;
      }
  
      double overlapAbs = overlapAbsolute(other);
      return overlapAbs / Math
          .max(lenThis, lenOther); // one of the lengths is guaranteed to be non-zero
    }
docs: Relative overlap, that is the overlap, divided by the length of the largest interval. If both
  intervals are single points and they're equal - returns 1
  
  @param other interval to compare to
  @return if the intervals are single points will return 1, if the points are the same. If a
  point is compared against a non-point interval, then the result is zero.