Re: New proposal for math.e
- Posted by CChris <christian.cuvier at agri??lture.gouv.fr> Aug 03, 2007
- 541 views
Juergen Luethje wrote: > > CChris wrote: > > <snip> > > > Since no one replied to my first proposal, I'll repeat it: add a gamma() > > function > > and an erf() function, since they re very commonly used in analysis and > > statistics. > > Note that an incomplete gamma function could be an even better idea than > > erf(), > > as erf() is a special, very frequent occurrence of incomplete_gamma(x,z) > > after > > a trivial transform. The general incomplete_gamma() arises in physics > > rather. > > The value of the Euler constant (=-gamma'(1)) would be a logical addition > > then > > too. > > > > 1/sqrt(2*PI) is a very common normalisation constant as well, both in > > statistics > > and in Fourier series calculations, so it may not hurt to have it on board > > as > > well. > > > > The most difficult thing here could be to port some Fortran code to Eu to do > > the above, assuming the C compiler don't have this as standard. There is > > ample > > supply of such free code. > > I do not even know the meaning of a gamma() and an erf() function, so I > can't provide code for them. But you probably can do so. > > Regards, > Juergen gamma(x) is the integral, over [0,+oo[, of power(t,x-1)*exp(-t)dt. The immense majority of asymptotic results in ODE, probability theory, nomber theory etc is expressed in terms of this function. incomplete_gamma(x,a) is the same integral over [0,a[ with a>=0. Calculations of electromagnetic fields generated by currents in solids/plasmas routinely let themselves expressed using this function. Additionally, it is a broad generalisation of the below. The erf() function is the integral, over ]-oo,x[, of exp(-t*t/2)dt, multiplied by 1/sqrt(2*PI). This is the distribution function of the centered, reduced Gauss normal density, to which 97% of all statistical results refer (because of the law of large numbers). A simple variable change shows that, if x>=0, erf(x)=1/2 + incomplete_gamma(sqrt(2*x),1/2)/sqrt(PI) And, because of the symmetry of the normal law, we have erf(x)+erf(-x)=1. CChris