[Rd] qbeta function (FYI, compiler bug)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
07 Jan 2002 16:47:32 +0100

Morten Welinder <terra@diku.dk> writes:

> Hi there,
> this is just to let you know that the qbeta function, which was
> copied from R into Gnumeric, has been confirmed to be miscompiled
> by gcc 2.96 on Linux.  (That's Red Hat's compiler.)

Which version? The ones in RH 7.1 and later has seemed to be quite
solid, whereas the one shipping with 7.0 was worthless (and so was the
first 50 or so fixup revisions of the compiler that should never have
been released...).

> This shows by qbeta(0.025,4,0.5) ending up taking the wrong
> branch of "if (alpha <= 0.5)".

> We compile things in a different context, so this may or may not
> affect you.  The qbeta function was taken from R 0.64.
> Morten

0.64 is 2.5 years old! Several things have been fixed since then,
including at least one really bad bug in qbeta(). You might want to
track the development of R a bit closer (&maybe note that R's math
library can now be compiled a a standalone dynlib).

The "if (alpha <= 0.5)" line has disappeared in recent versions, but I
don't see any trouble in the current version, compiled with

> pbeta(qbeta(0.025,4,0.5),4,.5)
[1] 0.025

   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