//https://stackoverflow.com/questions/2328258/cumulative-normal-distribution-function-in-c-c
#include <cmath> //exp() log()
#include <algorithm> //nth_element()
#include <iomanip> //erfc
double pnorm(double value)
{
double M = sqrt(0.5);
return 0.5 * erfc(-value * M);
}
// normalCFD(0) = 0.5
R语言
pnorm()