Re: [Gcl-devel] Re: m68k gcl/maxima: Minor Floating point errors
Subject: Re: [Gcl-devel] Re: m68k gcl/maxima: Minor Floating point errors
From: Camm Maguire
Date: 19 Sep 2002 14:21:12 -0400
Greetings! The machine is actually a 68060 running Debian, with gcc
connfigured for a 68020 with a coprocessor, as far as I can tell:
gcc --help -v
...
Options starting with -g, -f, -m, -O or -W are automatically passed on to
the various sub-processes invoked by gcc. In order to pass other options
on to these processes the -W<letter> options must be used.
gcc version 2.95.4 20011002 (Debian prerelease)
/usr/lib/gcc-lib/m68k-linux/2.95.4/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -Dunix -Dmc68000 -Dmc68020 -Dlinux -D__ELF__ -D__unix__ -D__mc68000__ -D__mc68020__ -D__linux__ -D__unix -D__mc68000 -D__mc68020 -D__linux -Asystem(unix) -Asystem(posix) -Acpu(m68k) -Amachine(m68k) -D__HAVE_68881__ --help help-dummy /tmp/ccGy7aJT.i
GNU CPP version 2.95.4 20011002 (Debian prerelease) (68k GNU/Linux with ELF)
...
680X0 options:
-l use 1 word for refs to undefined symbols [default 2]
-m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 | -m68060 |
-m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -m68360 | -mcpu32 |
-m5200 | -m5202 | -m5204 | -m5206 | -m5206e | -m5307 | -m5407
specify variant of 680X0 architecture [default 68020]
-m68881 | -m68882 | -mno-68881 | -mno-68882
target has/lacks floating-point coprocessor
[default yes for 68020, 68030, and cpu32]
-m68851 | -mno-68851
target has/lacks memory-management unit coprocessor
[default yes for 68020 and up]
...
So this can not be ascribed to fp emulation, right?
Take care,
Jakob Eriksson <jakob@vmlinux.org> writes:
> does your machine have a math coprocessor? a 68020 or 68020 with a 68881
> or a 68882?
> is it a 68040? if it is, is it a 680LC40?
>
> if it hos no coprocessor, there probably is a small fault in the
> floating point emulator.
> which is no big deal IMHO, we should be happy to have any FP emulation
> at all on m68k.
>
>
> Camm Maguire wrote:
>
> >Greetings! I have one Debian machine (m68k) which is producing very
> >small numerical discrepancies on the results of the two floating point
> >intensive tests in rtest8.mac:
> >
> >=============================================================================
> >/* ********************** Problem 8. *************** */
> >%Input is
> >SORT(ALLROOTS(%))
> >
> >
> >The result is
> >[X = - 1.015754699707032, X = 0.8296747207641602, X = 1.0,
> >
> >X = - 0.9659624099731445 %I - 0.4069597721099853,
> >
> >X = 0.9659624099731445 %I - 0.4069597721099853]
> >
> >This differed from the expected result:
> >[X = - 1.015755543828121, X = 0.8296749902129361, X = 1.0,
> >
> >X = - 0.4069597231924075 - 0.9659625152196368 %I,
> >
> >X = 0.9659625152196368 %I - 0.4069597231924075]
> >
> >/* ********************** Problem 24. *************** */
> >%Input is
> >SOLVE(%, [X, Y])
> >
> >
> >The result is
> >[[X = 2, Y = 2], [X = 0.5202593803405762 %I - 0.1331241130828857,
> >
> >Y = 0.07678413391113277 - 3.608001708984376 %I],
> >
> >[X = - 0.5202593803405762 %I - 0.1331241130828857,
> >
> >Y = 3.608001708984376 %I + 0.07678413391113277],
> >
> >[X = - 1.733751425313569, Y = - 0.1535679052943111]]
> >
> >This differed from the expected result:
> >[[X = 2, Y = 2], [X = 0.5202594388652008 %I - 0.1331240357358706,
> >
> >Y = 0.07678378523787777 - 3.608003221870287 %I],
> >
> >[X = - 0.1331240357358706 - 0.5202594388652008 %I,
> >
> >Y = 0.07678378523787777 + 3.608003221870287 %I],
> >
> >[X = - 1.733751846381093, Y = - 0.1535675710019696]]
> >
> >=============================================================================
> >
> >I notice that these are the two tests which also have commented
> >variable results on different machines in the rtest8.mac file:
> >
> >=============================================================================
> >sort(ALLROOTS(%));
> >[X = -1.0157555438281209,X = 0.82967499021293611,X = 1.0,
> > X = -0.96596251521963683*%I-0.40695972319240747,
> > X = 0.96596251521963683*%I-0.40695972319240747];
> >/* lispm
> >[X = 0.829675,X = -1.0157557,X = 0.9659626*%I-0.4069597,
> > X = -0.9659626*%I-0.4069597,X = 1.0000001]; */
> >/* result tops20 [X = 0.82967498,X = -1.01575564,X = 0.96596261*%I-0.406959705,
> > X = -0.96596261*%I-0.406959705,X = 1.00000006]$ */
> >SOLVE(%,[X,Y]);
> >[[X = 2,Y = 2],
> > [X = 0.5202594388652008*%I-0.1331240357358706,
> > Y = 0.07678378523787777-3.608003221870287*%I],
> > [X = -0.5202594388652008*%I-0.1331240357358706,
> > Y = 3.608003221870287*%I+0.07678378523787777],
> > [X = -1.733751846381093,Y = -0.1535675710019696]];
> >/* lispm
> >[[X = 2,Y = 2],[X = 0.52025807*%I-0.13312346,Y = 0.07678269-3.6080136*%I],
> > [X = -0.52025807*%I-0.13312346,Y = 3.6080136*%I+0.07678269],
> > [X = -1.7337531,Y = -0.1535668]]$ */
> >/* tops 20 :[[X = 2,Y = 2],[X = 0.52025944*%I-0.133124037,Y = 0.076783786-3.6080032*%I],
> > [X = -0.52025944*%I-0.133124037,Y = 3.6080032*%I+0.076783786],
> > [X = -1.73375185,Y = -0.153567577]]$ */
> >=============================================================================
> >
> >Questions:
> >
> >1) I take it this is still (likely a gcl) error, as all IEEE floating
> > point machines should produce an identical result, no? Should
> > these results vary somewhat in "correct" operation?
> >
> >2) I'd like to debug this at the lisp level. I've read the info pages
> > on the dbl mode, and can run the example cited. But when I try to
> > :br any function in the maxima source .lisp files, I'm told there
> > is no line info. What's the best way to see where this result is
> > varying in a maxima/lisp debugger?
> >
> >3) Any m68k cognoscenti care to suggest a likely explanation?
> >
> >Take care,
> >
> >
> >
> >
>
>
>
>
> _______________________________________________
> Gcl-devel mailing list
> Gcl-devel@gnu.org
> http://mail.gnu.org/mailman/listinfo/gcl-devel
>
>
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah