: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
JN == John Nolan jpno...@american.edu
on Tue, 4 Aug 2009 18:05:47 -0400 writes:
JN Ravi,
JN There has been a lot of chatter about this, and people don't seem to
be
JN reading carefully. Perhaps this will help
JN Sent by: r-devel-boun...@r-project.org
JN Date: 08/04/2009 10:59AM
JN cc: hwborch...@googlemail.com, r-de...@stat.math.ethz.ch
JN Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is
accurate)
JN Please forgive me for my lack of understanding of IEEE floating-point
: Tuesday, August 4, 2009 8:36 pm
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
To: Ravi Varadhan rvarad...@jhmi.edu
Cc: 'Martin Becker' martin.bec...@mx.uni-saarland.de,
hwborch...@googlemail.com, r-de...@stat.math.ethz.ch
Ravi,
There has been a lot of chatter about
: r-de...@stat.math.ethz.ch; hwborch...@googlemail.com
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Dear Ravi,
the inaccuracy seems to creep in when powers are calculated. Apparently,
some quite general function is called to calculate the squares, and one can
avoid
I checked, and both octave and yorick use multiplication for z^i where
i is an integer, leading to better accuracy. Octave uses an integer
power if it's stored as a double if it's close enough to an integer.
See:
http://hg.savannah.gnu.org/hgweb/octave/file/fb22dd5d6242/src/xpow.cc
I suspect that, in general, you may be facing the limitations of machine
accuracy (more precisely, IEEE 754 arithmetics on [64-bit] doubles) in
Dear Martin,
I definitely do not agree with this. Consider your own proposal of
writing the Rosenbrock function:
rosen2 - function(x) {
MM == Martin Maechler maech...@stat.math.ethz.ch
on Mon, 3 Aug 2009 19:30:24 +0200 writes:
HWB == Hans W Borchers hwborch...@googlemail.com
on Mon, 3 Aug 2009 13:15:11 + (UTC) writes:
HWB Thanks for pointing out the weak point in this
HWB computation. I tried
...@stat.math.ethz.ch; hwborch...@googlemail.com
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Dear Ravi,
the inaccuracy seems to creep in when powers are calculated. Apparently,
some quite general function is called to calculate the squares, and one can
avoid the error
[mailto:martin.bec...@mx.uni-saarland.de]
Sent: Tuesday, August 04, 2009 7:34 AM
To: Ravi Varadhan
Cc: r-de...@stat.math.ethz.ch; hwborch...@googlemail.com
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Dear Ravi,
I suspect that, in general, you may be facing
-Original Message-
From: Martin Becker [mailto:martin.bec...@mx.uni-saarland.de]
Sent: Tuesday, August 04, 2009 7:34 AM
To: Ravi Varadhan
Cc: r-de...@stat.math.ethz.ch; hwborch...@googlemail.com
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Dear Ravi,
I suspect
on behalf of Ravi Varadhan
Sent: Tue 8/4/2009 7:59 AM
To: 'Martin Becker'
Cc: hwborch...@googlemail.com; r-de...@stat.math.ethz.ch
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Please forgive me for my lack of understanding of IEEE floating-point
arithmetic. I have a hard
Subject: Re: [Rd] Inaccurate complex arithmetic of R (Matlab is accurate)
Please forgive me for my lack of understanding of IEEE floating-point
arithmetic. I have a hard time undertsanding why this is not a problem of
R itself, when ALL the other well known computing environments including
Matlab
Dear All,
Hans Borchers and I have been trying to compute exact derivatives in R using
the idea of complex-step derivatives that Hans has proposed. This is a really,
really cool idea. It gives exact derivatives with only a minimal effort
(same as that involved in computing first-order
Dear Ravi,
the inaccuracy seems to creep in when powers are calculated. Apparently,
some quite general function is called to calculate the squares, and one
can avoid the error by reformulating the example as follows:
rosen - function(x) {
n - length(x)
x1 - x[2:n]
x2 - x[1:(n-1)]
Thanks for pointing out the weak point in this computation. I tried out your
suggestions and they both deliver the correct and accurate result.
But as a general solution this approach is not feasible. We want to provide
complex-step derivatives as a new method for computing exact gradients, for
HWB == Hans W Borchers hwborch...@googlemail.com
on Mon, 3 Aug 2009 13:15:11 + (UTC) writes:
HWB Thanks for pointing out the weak point in this
HWB computation. I tried out your suggestions and they both
HWB deliver the correct and accurate result.
HWB But as a
16 matches
Mail list logo