code: static int tinyLambdaRand(double lambda) {
          double d, r;
          d = Math.sqrt(lambda);
          if (Math.random() >= d) {
              return 0;
          }
  
          r = Math.random() * d;
          if (r > lambda * (1.0 - lambda)) {
              return 0;
          }
  
          if (r > 0.5 * lambda * lambda * (1. - lambda)) {
              return 1;
          }
  
          return 2;
      }
docs: For extremely low values of lambda, the method is a simple
  calculation of the probabilities of x = 1 and x = 2. Higher values
  are ignored.
  <p>
  The reason for using this method is to avoid the numerical inaccuracies
  in other methods.