docs: private static double logSumExp(double[] x) {
      double max = x[0];
      for(int i = 1; i < x.length; i++) {
        final double v = x[i];
        max = v > max ? v : max;
      }
      final double cutoff = max - 35.350506209; // log_e(2**51)
      double acc = 0.;
      for(int i = 0; i < x.length; i++) {
        final double v = x[i];
        if(v > cutoff) {
          acc += v < max ? FastMath.exp(v - max) : 1.;
        }
      }
      return acc > 1. ? (max + FastMath.log(acc)) : max;
    }