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

Hans Boehm boehm at acm.org
Tue Feb 21 14:15:09 PST 2023


Paul -

Could you say more about what CORE-MATH is trying to do? Or give us a
pointer to a good paper to read?

The idea is that you would have a single routine for each of these
functions, independent of rounding mode? Presumably the usual
implementation would either avoid non-motonically-increasing operations,
i.e. negation, subtraction and division, or use them only in code that is
not material to the accuracy of the final result?

So this code could be used to implement either C23 static rounding modes,
or conceivably correctly rounded functions with explicit rounding mode
parameters? It just might not be the most efficient way to do so, since you
could call different functions for the different rounding modes instead?

Hans

On Tue, Feb 21, 2023 at 11:20 AM Paul Zimmermann <Paul.Zimmermann at inria.fr>
wrote:

>        Dear Hans,
>
> > Pretty much the rest of the committee preferred the simplest possible
> > library solution, i.e. free functions that operate directly on float and
> > double, with an explicit rounding mode argument. I plan to write that
> up. I
> > would expect such a solution to be C compatible, if there is interest.
>
> this would be incompatible with the large effort currently done in the
> CORE-MATH project, which builds upon the ISO C standard for using rounding
> in mathematical functions:
>
>    double x, y;
>    fesetround (FE_TOWARDZERO);
>    y = sin (x); /* or y = cr_sin(x) */
>
> You write-up should explain how to avoid throwing away this work
> (without loosing cycles).
>
> Best regards,
> Paul
>
> PS: if you only plan to suggest modifications in the C++ standard (not the
> C standard), please ignore this message.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20230221/1fb705f2/attachment.htm>


More information about the Cfp-interest mailing list