c语言实现高斯分布
#include
#include
#define PI 3.1座机电话号码5897
void main long double w,x,y 0,z,sum,b 1; int n 1,a 1,m 1; printf "Please enter x:" ; scanf "%lf",&x ; while n 101 //101决定最后结果的误差 w pow x,n ; z a*w/ b*n ; y+ z ; a* -1 ; b* 2*m ; //printf "%30.25f\n%d!! %30.25f\n",z,2*m,b ; //用于查看中途计算出得数据; m++; n+ 2 ; sum 0.5+y/sqrt 2*PI ; printf "The result you want is:Phi %f %15.10f\n",x,sum ; //下面是标准正态分布表:
//x 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
//0.0 0.50000 0.50399 0.50798 0.51197 0.51595 0.51994 0.52392 0.52790 0.53188 0.53586
//0.1 0.53983 0.54380 0.54776 0.55172 0.55567 0.55962 0.56356 0.56749 0.57142 0.57535
//0.2 0.57926 0.58317 0.58706 0.59095 0.59483 0.59871 0.60257 0.60642 0.61026 0.61409
//0.3 0.61791 0.62172 0.62552 0.62930 0.63307 0.63683 0.64058 0.64431 0.64803 0.65173
//0.4 0.65542 0.6