Re: [R] Numerical accuracy

From: Tuszynski, Jaroslaw W. <JAROSLAW.W.TUSZYNSKI_at_saic.com>
Date: Tue 28 Jun 2005 - 01:47:48 EST


I do not know about details of numerical accuracy of R, it is probable related to numerical accuracy of C compiler that was used to compile it (gcc ?).
However I would like to mention that I run into some problems with accuracy of sum and cumsum functions. See:

> x = c(1, 1e20, 1e40, -1e40, -1e20, -1)
> sum(x)

   [1] -1e+20
> cumsum(x)

   [1] 1e+00 1e+20 1e+40 0e+00 -1e+20 -1e+20 And wrote functions (with help of R-Help list) to address the problem. See sum.exact and cumsum.exact in caTools package:   > sum.exact(x)
  [1] 0
  > cumsum.exact(x)
  [1] 1e+00 1e+20 1e+40 1e+20 1e+00 0e+00  

Jarek

====================================================\=======

 Jarek Tuszynski, PhD.                           o / \ 
 Science Applications International Corporation  <\__,|  
 (703) 676-4192                                   ">   \
 Jaroslaw.W.Tuszynski@saic.com                     `    \

 

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Talita Perciano Costa Leite
Sent: Monday, June 27, 2005 10:57 AM
To: r-help@stat.math.ethz.ch
Subject: [R] Numerical accuracy

Hi people,

I need to prove the good quality of numerical accuracy of R. Anyone knows a paper or anything else comparing R to other statistical softwares in terms of numerical accuracy.
I've made a long search about that but I found nothing. Please help me!!

Thanx,

Talita Leite



Este e-mail foi enviado pelo Webmail da UFAL IMP:
http://horde.org/imp/

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jun 28 01:52:38 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:03 EST