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

Martin Maechler (maechler@stat.math.ethz.ch)
Mon, 5 May 97 16:41:44 +0200


Date: Mon, 5 May 97 16:41:44 +0200
Message-Id: <9705051441.AA00729@>
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: R-help@stat.math.ethz.ch
Subject: R-beta: R 0.49 -- "funny" bug: beta(.) gives  lbeta(.); lbeta(a,b) gives a

[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@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=