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

Re: Floating point



PureBytes Links

Trading Reference Links

At 07:49 AM 7/29/2001, Patrick Gamble wrote:
><snip>
>If the data is accurate to, say, two decimal places, then
>it is useless functionality to be able to deal with that data
>to six places. The data that Tradestation deals with is
>often not even accurate to two places.
<snip>

You might be interested in the following portion of a commentary dealing 
with the IEEE 754 floating point standard:

The standard puts the most emphasis on extended precision, making no 
recommendation concerning double precision, but strongly recommending that 
Implementations should support the extended format corresponding to the 
widest basic format supported, ...
One motivation for extended precision comes from calculators, which will 
often display 10 digits, but use 13 digits internally. By displaying only 
10 of the 13 digits, the calculator appears to the user as a "black box" 
that computes exponentials, cosines, etc. to 10 digits of accuracy. For the 
calculator to compute functions like exp, log and cos to within 10 digits 
with reasonable efficiency, it needs a few extra digits to work with. It is 
not hard to find a simple rational expression that approximates log with an 
error of 500 units in the last place. Thus computing with 13 digits gives 
an answer correct to 10 digits. By keeping these extra 3 digits hidden, the 
calculator presents a simple model to the operator.
Extended precision in the IEEE standard serves a similar function. It 
enables libraries to efficiently compute quantities to within about .5 ulp 
in single (or double) precision, giving the user of those libraries a 
simple model, namely that each primitive operation, be it a simple multiply 
or an invocation of log, returns a value accurate to within about .5 ulp.

You can find the entire commentary, "What Every Computer Scientist Should 
Know About Floating-Point Arithmetic," by David Goldberg at:

http://docs.sun.com/htmlcoll/coll.648.2/iso-8859-1/NUMCOMPGD/ncg_goldberg.html

Many Intel processors implement Double Precision in 64 bits and Extended 
Precision in 80 bits. Clearly Intel and IEEE do not feel this is "useless 
functionality."

Allan