I want to implement equivalent of matlab normcdf function in C++, I have already found this useful post: Cumulative Normal Distribution Function in C/C++ pointing to this implementation http://www.johndcook.com/cpp_phi.html. But I want it with optional mu and sigma parameters as in matlab.
Is it ok, when I change this:
x = fabs(x)/sqrt(2.0);
to:
x = fabs(x - mu)/sqrt(2.0 * sigma * sigma);
or I am supposed to do something else?