[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] inaccurate tabulated values in gsl-1.11/randist/gausszig.c
From: |
Joseph Pang |
Subject: |
[Bug-gsl] inaccurate tabulated values in gsl-1.11/randist/gausszig.c |
Date: |
Fri, 2 May 2008 10:22:40 -0700 (PDT) |
Hi,
The tables in the above file, implementing the Ziggurat method for Gaussian,
carry inaccurate numerical values. The problem is most likely due to the
inaccurate value of PARAM_R, which is defined as 3.44428647676.
The accurate value should be 3.442619855899. Even though the difference seems
small, it affects all the values in all the tables to various degree. The
extent of this impact to the accuracy of user programs is not known. By the
way, the accurate value did appear in the original paper by Marsaglia and Tsang.
The reason for the inaccurate values is due to the use of erfc approximation in
the original C program that generates the Ziggurat tables ( I dug up that C
program somewhere from the Web). It is easy to fix by using the accurate erfc
function in this program to re-generate the tabulated values.
Joseph Pang
- [Bug-gsl] inaccurate tabulated values in gsl-1.11/randist/gausszig.c,
Joseph Pang <=