src/nmath/pgeom.c (PR#1834)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
26 Jul 2002 00:28:16 +0200


terra@diku.dk writes:

> Full_Name: Morten Welinder
> Version: 1.5.1
> OS: Solaris/Linux
> Submission from: (NULL) (192.5.35.38)
> 
> 
> The line
> 
>     return log(1 - p) * (x + 1);
> 
> looks like it has problems for p near 1.  I would suggest rewriting it to
> 
>     return log1p (-p) * (x + 1);

I don't think that helps for p near 1. It might do so for p near 0,
though. (The whole thing is a bit esoteric since it only becomes
relevant when you want the upper tail and on a log scale.)

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._