code: private static double log1pe(double x) {
          double y = 0.0;
          if (x > 15) {
              y = x;
          } else {
              y += Math.log1p(Math.exp(x));
          }
  
          return y;
      }
docs: Returns natural log(1+exp(x)) without overflow.