[erlang-questions] Gaussian Distribution

Frank Recker <>
Thu Nov 1 21:33:51 CET 2012


On Thu, November 1, 2012 06:52, Richard O'Keefe wrote:
>> On Mon, Oct 29, 2012 at 5:59 AM, Frank Recker <>
>> wrote:
>>> Your points are correct, but I had reasons for my design choices.
>>>
>>> - math:erf/1 was not available in my windows version of erlang
>>>
>>> - under linux math:erf/1 delivers the value 1 for large x (x>7), which
>>> is
>>> problematic. The exact value is always in the open interval (-1,1).
>
> This is floating-point we are talking about.
> For sufficiently large x, the closest floating point number WILL
> be 1, like it or not.  erf() is doing the best it possibly can.

Right, but at you cannot blame the floating accuray of erlang alone. Here
is an example under Linux (where erf exists):

1> math:erf(6.0).
1.0
2> gaussianDistribution:integral(6.0,500).
0.9999999991312835

Frank




More information about the erlang-questions mailing list