Displaying 1 result from an estimated 1 matches for "gnum_float".
Did you mean:
gnm_float
2002 Oct 25
0
qgamma precision (PR#2214)
...of about 1e-8. This fits nicely with the code'd EPS2
value of 5e-7.
To solve this I added a newton step at the end. This seems far cheaper than
the
current iterations. Here's the code I added (to replace the final return):
/* Special Gnumeric patch to improve precision. */
{
gnum_float x0 = 0.5*scale*ch;
gnum_float e0 = pgamma (x0, alpha, scale, lower_tail, log_p) - p;
if (e0 != 0 && lower_tail && !log_p) {
gnum_float d0 = dgamma (x0, alpha, scale, log_p);
if (d0) {
gnum_float x1 = x0 - e0 / d0;
gnum_float e1 = pgamma (x1, alpha, scale, lower_tail...