Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Fw: Rounded operations: test



P1788,

I am forwarding this e-mail, as requested by Iwona.

Sincerely,

Nate


On Sun, 10 Jul 2011 17:08:28 -0500, Nate Hayes wrote:
Iwona,

FYI: I received this message to my personal inbox, but it appears a
copy did not get sent to the P1788 mailing list.

You may wish to try again, or if you'd like I could forward for you.

Nate,

Please forward my message to the P1788 mailing list.

Iwona


----- Original Message ----- From: <skalna@xxxxxxxxxx>
To: "Nate Hayes" <nh@xxxxxxxxxxxxxxxxx>
Sent: Sunday, July 10, 2011 2:18 PM
Subject: Re: Rounded operations: test


On Sun, 10 Jul 2011 12:38:51 -0500, Nate Hayes wrote:
Baker, P1788,

I ran a few tests this morning.

The first test performs 1 billion additions by explicitly:
   -- saving the state of the processor rounding mode
   -- setting rounding mode to "round up"
   -- performing the floating-point addition
   -- restoring the processor rounding mode to the saved state

The second test performs 1 billion additions in "round to nearest" mode by:
   -- performing the floating-point addition
   -- adjusting the result of the addition by incrementing 1 ULP


Both tests were run on
   AMD Athlon 64 FX-60 Dual Core Processor 2.60 GHz
on 64-bit Windows 7, and compiled with Microsoft Visual Studio 2010 Ultimate
optimizing compiler.

Attached is the source code so people could try running on different
platforms, if they wish.


I am sorry for the previous post, I pressed the wrong button and I send
an unfinished message.

I tried the code provided by Nate Hayes. I run it on
Intel i5 2.27GHz
on 64-bit Windows 7
and compiled the code with Microsoft Visual Studio 2008 Professional
optimization was set to Maximum speed.

I got the following result (if any one is interested):

21400, 2.14e-005
21400, 2.14e-005
1000000000 additions:
Changing rounding mode: 6 seconds
Nextup method: 12 seconds
Press any key to continue . . .

Best regards,
  Iwona Skalna