From p.dalgaard@biostat.ku.dk  Sun Apr 25 00:41:04 1999
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 25 Apr 1999 01:41:04 +0200
Subject: [S] uniroot -- doesn't work recursively
In-Reply-To: Martin Maechler's message of "Fri, 23 Apr 1999 19:13:32 +0200"
References: <199904220944.LAA10647@gwen.stat.unipd.it.> <199904231713.TAA15277@sophie.ethz.ch>
Message-ID: <x2yajhh9in.fsf@blueberry.kubism.ku.dk>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[S] uniroot -- doesn't work recursively
Peter Dalgaard BSA