code: public static double cdf(double x, double sigma) {
      if(x <= 0.) {
        return 0.;
      }
      final double xs = x / sigma;
      return 1. - FastMath.exp(-.5 * xs * xs);
    }
docs: CDF of Rayleigh distribution
  
  @param x Value
  @param sigma Scale parameter
  @return CDF at position x.