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

Re: Need fixed StandardError function



PureBytes Links

Trading Reference Links

   Date: Sun, 21 Mar 2004 09:58:30 -0800 (PST)
   Sender: unicorn@xxxxxxxxx
   From: Alex Matulich <alex@xxxxxxxxxxxxxx>

   >   I always wondered why the calculations are single-precision.  That always
   >   seemed stupid to me.
   >
   >Speed.

   No, not speed.  Floating point math these days is almost always
   handled by a math coprocessor (nearly all computers have had them
   since the early 1990s) and math coprocessors are designed to run
   optimally for double-precision math.

Yes, it is speed.  Big differences between double and single precision
and as far as I know, no generally available SSE2 compiler exists.
Visit:

http://www.cs.utk.edu/~rwhaley/ATLAS/x86.html

(if that link doesn't show tables with speed differences between
various Pentiums and Athons, mention that and I'll look again.
utk.edu is unavailable from here at the moment).

At the bottom of that webpage, you should notice that single precision
is 4x faster than double precision for the majority of Intel
processors.  However, you certainly do need double precision for
reliable 6 digit results (such as 1400.00)...but the differences are
only in pennies otherwise and thus unimportant back before
decimalization.  If you are running a P4, you would need a special P4
only version of the code to gain the x2 factor.  The table also
indicates why most numerical projects pick AMD systems.


   >plus most programmers are mathematically incompetent.

   Well, there's that...  I see a number of functions in EL that look
   like they were written by following a classical math textbook rather
   than a book on efficient computer algorithms.

Being able to read a math textbook puts them above a few I've managed.