Re: [R] Solving 100th order equation

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Mon, 26 May 2008 09:03:57 +0200

Rolf Turner wrote:
>
> On 26/05/2008, at 10:38 AM, Hans W. Borchers wrote:
>
>> Rolf Turner <r.turner <at> auckland.ac.nz> writes:
>>
>>>
>>> [...]
>>>
>>> However uniroot(p,c(1.995,2.005)) gives
>>>
>>> $root
>>> [1] 1.999993
>>>
>>> $f.root
>>> [1] -4.570875e+24
>
> Whoops! I read that e+24 as e-24, so scrub all that I said.
> (You'd think, that having seen Bill Venables make a similar
> error --- which he corrected in the follow-up posting to which
> I was replying --- I would've been more careful. Well, you'd
> think wrong. Actually it *was* e-24 when I posted; then the
> Gremlins got in and changed everything. :-) )
Hehe....

If you think about it, if you have x^100 in the expression, then when you get out to about x=2, you'll need 100 binary digits to store the value to integer precision, so anything working with standard finite precision arithmetic is going to go wrong because the measly "4000" in the equation is going to be completely swamped out.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 26 May 2008 - 07:06:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 26 May 2008 - 08:30:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive