Skip to content
Prev 12168 / 63424 Next

pgeom accuracy (PR#6687)

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


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.