Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion P1788/M0045.02:ExactDotProductRevision -- revised text



On 2013-07-05 15:17:36 -0400, Michel Hack wrote:
> > On 2013-07-05 10:06:12 +0100, John Pryce wrote:
> > > If there is a danger of clashes such as Vincent suggests, just
> > > name the 1788 ones differently!  The underlying 754 system may
> > > call it dot(), the new one can be dot1788(), etc.
> >
> > The name doesn't matter.  Having two different functions provided
> > by two different standards for the same operation is a bad thing.
> 
> If the two functions are equally useful (perhaps in different contexts),
> the choice is typically made available through macros that hide any
> necessary renaming, with the selection based on compiler options or
> environment variables.

This is dirty and may possibly be forbidden by the language standard.

> If a program depends on strict 754 semantics (e.g. exact zero as -0
> when rounding towards -Inf), it might be forced to pick the 754 version.
> Actually, this point is moot, because correct rounding is not required.
> 
> However, because of that laxity, the 754 version could be faster,
> and hence be preferred to the correctly-rounding 1788 version.
> 
> If a program depends on correct rounding it will of course have
> to select the 1788 version.

No, this is not obvious, and this may be a bad choice. It may happen
that on some platform, a correctly-rounded 754 version is available
(as it is now recommended), but a 1788 library is not available (or
will add bloat, e.g. a full interval arithmetic library just to use
a floating-point function already available in the standard math
library). P1788 will tend to discourage programmers from using the
standard version (the 754 one), unless languages are modified to
require these operations correctly rounded.

> This is the same choice that applies to transcendental functions,
> if one version is 754-compliant but slower than another version.
> This is possible in a 754-compliant implementation because the
> compliant versions of those functions are not required.

This is different because there is only one standard version of
these functions.

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