code: @Override
      public double getValue(double quantile) {
          if (quantile < 0.0 || quantile > 1.0 || Double.isNaN( quantile )) {
              throw new IllegalArgumentException(quantile + " is not in [0..1]");
          }
  
          if (values.length == 0) {
              return 0.0;
          }
  
          int posx = Arrays.binarySearch(quantiles, quantile);
          if (posx < 0)
              posx = ((-posx) - 1) - 1;
  
          if (posx < 1) {
              return values[0];
          }
  
          if (posx >= values.length) {
              return values[values.length - 1];
          }
  
          return values[posx];
      }
docs: Returns the value at the given quantile.
  
  @param quantile    a given quantile, in {@code [0..1]}
  @return the value in the distribution at {@code quantile}