[Rd] qpois accuracy, efficiency, termination (PR#7900)

mwelinder at gmail.com mwelinder at gmail.com
Thu May 26 22:55:28 CEST 2005


Full_Name: Morten Welinder
Version: 2.1.0
OS: src only
Submission from: (NULL) (216.223.241.226)


The qpois code has several problems in 2.1.0:

1. The code essentially does...

      z = qnorm(R_DT_qIv(porig), 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE);

   ...when it could just as well do...

      z = qnorm(porig, 0., 1., lower_tail, log_p);

   That would eliminate a lot of underflows.

2. A third party tells me that you want "gamma = 1 / sigma", not "gamma =
sigma".
   That should speed things up a lot.

3. If y>1/DBL_EPSILON (or a bit larger if intermediate results have better
   accuracy than double) then the loops will not terminate.  And, yes, the
   "fixme" is right that stepping is a bit too primitive.



More information about the R-devel mailing list