Re: floating-point operations on modern hardware
- From: David Bateman <dbateman@xxxxxxx>
- Date: Wed, 20 Jun 2007 00:43:28 +0200
kevinclancy_@xxxxxxxxxxx wrote:
I would like to know what algorithms modern computer hardware
(specifically the Pentium IV) uses to perform floating-point
arithmetic operations. Can anyone forward me to an official document
that contains this information? If not, could you give me a maximum
error bound for the basic operations? (+,-,*,/) I tried to find this
information in the IEEE 754, but the link to the IEEE 754 document on
IEEE's website is broken.
I have tried coding my own floating-point numbers using fixed-point
integers to represent the exponent and mantissa. I have tried to
implement the operations such that they return the closest
representable floating-point value to the ideal result. My solution is
very straightforward, but I'm not sure if it's the same algorithm that
my computer is using. The results of my operations tend to be slightly
different from the results computed in hardware. Could this be a
rounding error on my part? It would help a lot if I knew the
hardware's expected error from ideals.
Thanks in advance,
Kevin
The pentium 4 hardware has registers internally for floating point
calculations that have more precision that an IEEE754 double. This means
that if the optimizer kept your calculation in the registers between
intermediate steps then you might find that you have excess precision
with your pentium 4 relative to your own fixed point implementation. The
optimizer will do this to avoid a copy from the register to memory and
another back from the memory to the register.
If you are using a Gnu compiler, look at the "-float-store" option that
forces all intermediate steps of the calculations into memory. You
should then have fully IEEE754 conformant floating point math..
D.
.
- References:
- floating-point operations on modern hardware
- From: kevinclancy_
- floating-point operations on modern hardware
- Prev by Date: Re: Lagrange Interpolation
- Next by Date: Re: Lagrange Interpolation
- Previous by thread: floating-point operations on modern hardware
- Next by thread: Re: floating-point operations on modern hardware
- Index(es):
Relevant Pages
|