class NormalDist {

    public double cdf(double mean, double std, double x) {
        double zscore = (x - mean) / std;

        if (zscore > MAXZSCORE) {
            return 1.0;
        }
        if (zscore < MINZSCORE) {
            return 0.0;
        }

        // Interpolate the CDF
        double exactEntry = zscore / GRANULARITY + LUT_OFFSET;
        int lowerEntry = (int) FastMath.floor(exactEntry);
        int higherEntry = (int) FastMath.ceil(exactEntry);

        if (lowerEntry == higherEntry) {
            return CDF_LUT[lowerEntry];
        } else {
            return CDF_LUT[lowerEntry] +
                    ((exactEntry - lowerEntry) * (CDF_LUT[higherEntry] - CDF_LUT[lowerEntry]));
        }
    }

    public  NormalDist();

}