code: private static double log(double x) {
          double y = 0.0;
          if (x < 1E-300) {
              y = -690.7755;
          } else {
              y = java.lang.Math.log(x);
          }
          return y;
      }
docs: Returns natural log without underflow.