<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Courier New"><br>
Dear all,<br>
<br>
I was comparing the accuracy of FFT and two exact formulas for the
FFT of a complex exponential and I was first surprised by a
relative accuracy of only 10^-13 for N = 4096, but on second
thought it may be related to arithmetic errors due to about
N*log2(N) sums and products. <br>
<br>
But I was much more surprised to detect similar errors between
different exact formulas. These formulas involve a few instances
of exponentials so I conjectured that the problem may be related
to the exponential accuracy. When trying to find some information</font><font
face="Courier New"> about accuracy</font><font face="Courier New">
in the documentation I found none. <br>
<br>
The only mention in the elementary function set to accuracy
appears in log1p(), a strange function equal to log(1+x), which is
seemingly included to fix some accuracy problem of the natural
logarithm very close to 1. Intuition suggests that near 1 the
Taylor approximation for log(1+x) should work very well. I guess
that is what log1p() does, so I wonder why a function such as
log1p is really necessary. It seems more reasonable to internally
detect the favorable situation and switch the algorithm to get the
maximum attainable accuracy. So if one needs an accurate log(1+x)
function, one would</font><font face="Courier New"> just</font><font
face="Courier New"> type log(1+x)!<br>
<br>
But regardless of this discusion, I think it would very useful
some hints about accuracy in the help pages of elementary and
other functions.<br>
<br>
For instance, with format(25)<br>
<br>
--> exp(10) <br>
 ans =<br>
  22026.4657948067<u>1</u>7894971<br>
<br>
while the Windows calculator (which is generally accurate to the
last shown digit) yields<br>
<br>
22026.4657948067<u>1</u>6516957900645284<br>
                <br>
The underlined digits are the least significant ones common to
both solutions. Scilab shows up to 25 digits, but only the first
16 of them are accurate.<br>
<br>
Regards, <br>
<br>
Federico Miyara<br>
<br>
</font>
</body>
</html>