docs: public static int argMax(final double[] x) {
      checkArgument(x.length > 0);
      double maxValue = Double.MIN_VALUE;
      int maxIndex = 0;
  
      for (int i = 0; i < x.length; ++i) {
        final double val = x[i];
        if (val > maxValue) {
          maxIndex = i;
          maxValue = val;
        }
      }
      return maxIndex;
    }