title: Java library for calculating the normal distribution function
body: <p>I am using the Apache Commons library (<code>org.apache.commons.math3.distribution.NormalDistribution</code>) for calculating the normal distribution. My program is cyclic so it repeats this process. After some 30-40 cycles, I obtain question marks instead of the values. While debugging I have found that the program sees NaN (not a number), whereas I am sure that I put numbers there. The output looks like this:</p>
  
  <p>� � � � � � � � � � � � � � � �</p>
  
  <p>The piece of code:</p>
  
  <pre><code>private double normDistr(double num){
      double nd = 0;
      NormalDistribution n = new NormalDistribution(0,30);
      nd = 1.0 - n.cumulativeProbability(num);
      //System.out.println("ND " + nd);
      return nd;
  }
  </code></pre>
  
  <p>Any idea of what could be the cause of the problem?
  Or, could you recommend me any other library for these purposes?</p>
  
  <p>Thank you.</p>