// output a table of values for the normal distribution function #include #include #include using namespace std; const double pi=3.1416; double f(double x){ return (1./sqrt(2*pi))*exp( -x*x/2. ); } int main() { ofstream ofile("normal.csv"); // open file for output for (double x=-5.; x<=5.; x+=0.01) // go over many values of x in [-5,5] ofile << x << ", " << f(x) << endl; // output to file ofile.close(); // close file }