R-beta: R 0.49 -- "funny" bug: beta(.) gives lbeta(.); lbeta(a,b) gives a

Martin Maechler maechler at stat.math.ethz.ch
Mon May 5 16:41:44 CEST 1997


[I send this to R-help, since the bug may affect users..]

The beta(.)  and  ln(beta(..))  functions are not giving proper results in
R-0.49.
This does NOT affect usual beta-distribution calculations, since the
internal  beta(.) and lbeta(.) are okay.

beta(1,2)
[1] -0.6931472

exp(beta(1,2))
[1] 0.5

lbeta(3,4)
[1] 3

------- For  R-devel'ers :

Using gdb clearly shows that
	beta(.) really uses the C function lbeta(.)
and    lbeta(.) doesn't call either one. 

The bug has already been in  0.50--"pre 3", but is not in 16.1.
It must have been caused by the addition of all the complex stuff.

I've looked in src/main/names.c  and  arithmetic.c
and couldn't see any 'code' error 
	{do_math2(..) code / math2() switch statement}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help 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-help-request at stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the R-help mailing list