Bug in gmp/mpfr/mpc, never ending ctan computation

Vincent Lefevre vincent at vinc17.net
Mon Nov 19 13:46:52 UTC 2018

On 2018-11-19 14:17:13 +0100, Niels Möller wrote:
> You might want to add an entry for "Exponent range" to the concept index
> in the manual.

The concept index already has "Exponent", and the corresponding
paragraph is:

   An “exponent” is a component of a regular floating-point number.  Its
C data type is ‘mpfr_exp_t’.  Valid exponents are restricted to a subset
of this type, and the exponent range can be changed globally as
described in *note Exception Related Functions::.  Special values do not
have an exponent.

I think that this is quite explicit.

> I guess gcc should set things up similarly to the example on that page,
> "This is an example of how to emulate binary double IEEE 754
> arithmetic", with the caveat "This emulates a double IEEE 754 arithmetic
> with correct rounding in the subnormal range, which may not be the case
> for your hardware".

AFAIK, GCC already changes the exponent range to the binary64 one
(the lack of subnormals is not an issue, because in case of underflow,
GCC ignores the computations done with MPFR).

But for its internal computations, I assume that mpc extends the
exponent range (if it didn't you would have the same kind of problem,
but much more often). Here it seems that the issue is that the maximum
supported exponent range is not large enough for the chosen algorithm
(which may not be the right one for this kind of input).

Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

More information about the gmp-bugs mailing list