[S] uniroot -- doesn't work recursively

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
25 Apr 1999 01:41:04 +0200

Martin Maechler <maechler@stat.math.ethz.ch> writes:

> Dear Prof Azzalini,
> You have an interesting example of  recursive use of  uniroot().
> Fellow R-code developpers :  
>        Does anyone of you feel like fixing these?
>        Would be really nice and useful!
>        (and you will become famous in the R community ... :-)

Well, uniroot calls zeroin which is a FORTRAN routine. As long as this
is the case, all bets are off as to whether or not it will be
reentrant on any given system. In principle, it is not, and FORTRAN
just plain states that "you cannot do that", but if your compiler
happens to be f2c-like, and no global storage is involved, then it
*might* work after all. The example doesn't work on my system either.

The only sensible thing to do to get this to work is to rewite zeroin
in C. According to the comments in the file, it is a transcription of
an Algol60 program, so it is probably not hard to convert it to
another Algol descendant.

   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