code: public static double optimalSlofFixedPoint(
        double[] data,
        int dataSize
    ) {
      if (dataSize == 0) {
        return 0;
      }
  
      double maxDouble = 1;
      double x;
      double fp;
  
      for (int i = 0; i < dataSize; i++) {
        x = Math.log(data[i] + 1);
        maxDouble = Math.max(maxDouble, x);
      }
  
      fp = Math.floor(0xFFFF / maxDouble);
  
      return fp;
    }
docs: ///////////////////////////////////////////////////////////////////////////////