gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: m68k gcl/maxima: Minor Floating point errors


From: Jakob Eriksson
Subject: [Gcl-devel] Re: m68k gcl/maxima: Minor Floating point errors
Date: Thu, 19 Sep 2002 17:40:05 +0200
User-agent: Mozilla/5.0 (Windows; U; Win95; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0

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,








reply via email to

[Prev in Thread] Current Thread [Next in Thread]