Re: Fixed point Vs Floating point



John Larkin wrote:
On Mon, 16 Jun 2008 22:52:39 -0400, Phil Hobbs
<pcdhSpamMeSenseless@xxxxxxxxxxxxxxxxxx> wrote:

John Larkin wrote:

Some famous person said :If you absolutely have to use floating point,
you don't understand the problem."

Obviously a FORTH bigot. ;)

This is right in instruments, but not e.g. in a math program, where part of the point is that you don't want to limit what the user can do. The dynamic range of any instrument is far less than that of an IEEE single-precision float.

Not a DDS synthesizer. Or a digital delay generator. Some of the DDGs
I've done wouldn't even work in double floats.


Fair enough in that case--time and frequency is a teensy little bit more precise than ADCs, it's true. ;)

Still, though, you know in advance the step size you'll be using, which helps a lot in designing the arithmetic.

IEEE 754 floating point is great in theory, but there's no hardware support on any CPU I know of for some of its features--especially denormalized numbers.(*) The unimplemented features have to be emulated by the runtime handling the EM_DENORMAL exception in software on _every_ _single_ _operation_, which takes *forever*. On my big EM simulator, I have to fill the entire volume with noise of a few times FLT_MIN before starting to avoid it running like molasses for several hundred iterations until all the denormals get flushed out. Now *that's* stupid and inefficient. (Some compilers support turning off denormals (its' usually called "flush to zero", but gcc doesn't.)

IEEE 754 assumes that there'll be hardware acceleration, which there is on higher-end CPUs--they've got all those transistors available, so they might as well do something useful with them. POWER 6 CPUs dispatch 2 floating point and one integer operation per clock, iirc.

If the guy designing the instrument is also designing the arithmetic, all is copacetic--though laborious. Otherwise, give me hardware FP any day.

So I think that maxim of yours goes in the 'curmudgeonly half-truth' category, along with my favourite one of Rutherfords: "If your experiment needs statistics, you ought to have done a better experiment."

Cheers,

Phil Hobbs

(*) Denormals are numbers whose exponents are more negative than can be represented in the IEEE format--so the exponent stays pegged low and digits shift off to the right as the number shrinks. It's a theoretically cute way of reducing rounding error due to underflow when summing terms of widely different sizes. In practice it's a big nuisance.
.


Quantcast