[Rd] pgeom accuracy (PR#6687)

terra at gnome.org terra at gnome.org
Tue Mar 23 19:10:07 CET 2004

Full_Name: M. Welinder
Version: 1.6.2 and 1.8.1
OS: Solaris
Submission from: (NULL) (

The common lower_tail==TRUE && log_p==FALSE case can be improved as

  if (lower_tail && !log_p)
    return -expm1 ((x + 1) * log1p (-p));

This improves precision when p is very small and x not too big by
avoiding two problematic "1-sth" calculations.

More information about the R-devel mailing list