Sun 28 Mar 2010 12:48:27 PM UTC, comment #5:
Dear Jarno,
Your guess about MingW being the source of the inaccurate trig. functions seems to be correct. I have just installed the latest Cygwin and here is what I get:
GNU Octave Version 3.2.4
Operating System: CYGWIN_NT-6.1-WOW64 1.7.2(0.225/5/3) 2010-03-24 21:12 i686
Dell Precision 690, Intel 2xQuad-Core E5345 @ 2.33GHz
16GB RAM, Windows7 64-bit Professional.
octave:8> x=1e22;
octave:9> disp([sin(x) cos(x) tan(x)])
-8.52200849767189e-01 5.23214785395139e-01 -1.62877822560690e+00
These results are much better but notice that sin(1e22) has an error of 1 in the last place: the correctly-rounded-to-16-digits value is -8.522008497671888e-01 because at much higher precision sin(1e22) = -8.522008497671888 | 01772...e-1
This may seem to be a trivial matter but Intel, AMD, IBM, Jean-Michel Muller, William Kahan, etc., think it is very important, and spend a lot of time, effort, and money to get the correctly-rounded results. Remember that Intel in 1995 nearly lost $450,000,000 because they messed up the 'simple' floating point x/y calculation.
Thanks for your attention.
Derek O'Connor
|