programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: Fpmath.f with Hardward Stack

From: Bill McCarthy <WJMc_at_pobox.com>
Date: Wed, 14 Nov 2001 22:48:21 -0500

0n 11/14/2001 at 5:27 am, Charles Melice wrote:

> I cannot reproduce the problem.
>
> To test, I run two instances of your code + another graphic
> application written in SwiftForth using intensively the FPU.
>
> Result is e ~ 2.7182820520.

That's the same result I receive for both SwiftForth and the
two C compilers. I repeated the tests again tonight with a
small modification to cause the loop to be repeated 10 times
so I had time to switch between the four windows while they
ran. First, here's the new fptest.f:

-----------------------------------------------------------------
1.000000001E0 fconstant factor

: fptest ( -- )
 factor #1.0E 1000000000 0 do fover f* loop cr f. fdrop ;

: doit
    10 0 do fptest loop ;

cr .( Type 'doit' to run the test.) cr
-----------------------------------------------------------------

For each SwiftForth app, I used the distribution release and
loaded the fpmath.f from the tools menu, included the test
fptest.f, and typed 'doit'.

I could easily switch between the two C code tests. The
SwiftForth window wouldn't let me actually switch to it
except when it was writing to the screen. Nonetheless, I
kept switching to all four windows during the duration of
the tests. Here's the complete screen dump of the two
SwiftForth windows:

left window:
-----------------------------------------------------------------
SwiftForth 2.2.2.9 07May2001
CHOOSE-OPTIONS ok
INCLUDING-OPTION C:\util\SWIFTFORTH\LIB\OPTIONS\` Fpmath.f ok
include fptest
Type 'doit' to run the timer loop.
 ok
doit
2.7182820520
2.7182820520
2.7182820520
2.7182820520
-12000007614...followed by 1,395 zeros
2.7182820520
2.7182820520
2.7182820520
-12000007614...also followed by 1,395 zeros
0.0000000000 ok
-----------------------------------------------------------------
As one can see, it failed 3 of 10 times

right window:
-----------------------------------------------------------------
SwiftForth 2.2.2.9 07May2001
CHOOSE-OPTIONS ok
INCLUDING-OPTION C:\util\SWIFTFORTH\LIB\OPTIONS\` Fpmath.f ok
include fptest
Type 'doit' to run the timer loop.
 ok
doit
2.7182820520
0.0000000000
doit No floating point number to print

  ok
-----------------------------------------------------------------
Here it succeeded once, failed once, then got all screwed up.

> In another test, I run a raytracer, start your code sample,
> start another SF/FPU based application, stop it, stop
> the raytracer, ...
>
> On Win2k build 2195.
> SwiftForth 2.00.3 19may2000
> Tested using "Wait on exception" ON and OFF.

I'm running on Win2k build 2195 Service Pack 2.
SwiftForth 2.2.2.9 07May2001
Tests with hardware stack, wait OFF, 64 bit rounding nearest

Thanks Charles for taking the time to test this - perhaps
your release of SF is more stable.

Is anyone from Forth, Inc. reading this?

Bill

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe sftalk" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/sftalk -- check them out!
Search the archives! Visit http://www.forth.com/search for details.
Received on Wed Nov 14 2001 - 19:53:02 PST

This archive was generated by hypermail 2.2.0 : Fri Nov 21 2008 - 03:04:19 PST