What is the minimum precision allowed for floats.

Vincent Diepeveen diep at xs4all.nl
Mon Sep 29 15:45:36 CEST 2008

Of course you're right Paul about all this;

How do you emulate a FFT you plan to write on a GPU,
or other hardware without the big hassle of buying 2 videocards
and the entire additional hardware needed (a full computer with pci-e  
16x and a second
videocard, which gets used to adress the OS)?

You need some estimation on the number of instructions,
before doing the big effort to write optimal code for such
type of hardware and/or designing such a chip.

Heard a guy who helped me write a FFT (integers) he's using a nvidia  
280 GTX now
and his 680 watt PSU can't even power it up decently, it's total  
uncoolable :)

For all this emulations are needed.

On Sep 29, 2008, at 3:33 PM, Paul Zimmermann wrote:

>> Date: Sun, 28 Sep 2008 22:47:50 +0200
>> From: "Joel Kronander" <joekr552 at student.liu.se>
>> Hi
>> I have a question regading the possible minimun precision for floats.
>> For example is it possible to use a precision between native c  
>> float and
>> double
>> ie precision digits between 6-15 for exmample.
>> /best regards Joel Kronander
> I guess your question is related to the mpf class. The manual says:
>       The precision selected for a variable is a minimum value, GMP  
> may
>    increase it a little to facilitate efficient calculation.   
> Currently
>    this means rounding up to a whole limb, and then sometimes having a
>    further partial limb, depending on the high limb of the  
> mantissa.  But
>    applications shouldn't be concerned by such details.
> If you look in the internal file gmp-impl.h you will see:
> /* __GMPF_BITS_TO_PREC applies a minimum 53 bits, rounds upwards to  
> a whole
>    limb and adds an extra limb.  __GMPF_PREC_TO_BITS drops that  
> extra limb,
>    hence giving back the user's size in bits rounded up.  Notice that
>    converting prec->bits->prec gives an unchanged value.  */
> #define __GMPF_BITS_TO_PREC(n)						\
>   ((mp_size_t) ((__GMP_MAX (53, n) + 2 * GMP_NUMB_BITS - 1) /  
> thus you *can* ask for a precision of 6 or 15 bits, but then GMP  
> will allocate
> 3 words on a 32-bit computer, and 2 words on a 64-bit computer, and  
> it will
> have the same effect as if you had asked for 53 or 64 bits.
> If you want to have a precision of *exactly* 6 bits, I suggest you  
> try MPFR
> (see mpfr.org). It also works for 15 bits.
> Paul Zimmermann
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at swox.com
> https://gmplib.org/mailman/listinfo/gmp-discuss

More information about the gmp-discuss mailing list