[Cfp-interest 2700] Re: Floating point rounding modes

Paul Zimmermann Paul.Zimmermann at inria.fr
Wed Feb 22 02:52:08 PST 2023


       Vincent,

> A question: The code is designed to work in all rounding modes.
> But couldn't it be made simpler/faster if the rounding mode is
> known to be rounding to nearest (assuming that the processor
> has static rounding modes)?

maybe it would save one bit in the error analysis.
However, if all computations are done with rounding to nearest,
how would you round the final double-double approximation hi+lo
towards say +Infinity?

> But how is the code used currently? With GCC, it is known that
> changing the rounding mode is not supported. I don't know about
> the other compilers. Another question is: Will future processors
> support static rounding modes, knowing that the current situation
> is rather bad (changing the rounding mode is very slow, and
> dynamic rounding modes also make optimization more difficult
> and partly impossible)?

as I said previously on this list, the user can use the code as follows,
following the ISO C standard:

   double x, y;
   fesetround (FE_TOWARDZERO);
   y = sin (x); /* or y = cr_sin(x) */

Best regards,
Paul


More information about the Cfp-interest mailing list