[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Meeting the Scope and Purpose of P754
Florent de Dinechin addressed two separate reproducibility requirements.
Background: we are designing portable, correctly-rounded elementary
functions, for which reproducibility is simply a must.
Not at all! This is precisely the situation where the final result will
be exactly reproducible regardless of how intermediate computations are
done, provided of course that the algorithm takes floating-point behaviour
into account, as a professional-quality program like Ar©naire would.
The reason is that the algorithm computes a mathematically-defined value,
so there is only one possible result. Such mathematically exact results
are obtained by proving that the difference between the floating-point
result and the mathematically-exact value is strictly less than half ulp.
The exact value of that difference is however irrelevant, and runs of the
same algorithm on different hardware, or using different compilers or
option settings, will in general yield different final rounding errors.
The reproducible mode that Bob Davis and David Hough are pushing would
however require that even this irrelevant quantity, final roundoff error,
be bit-for-bit identical. Some people like this because it frees the
programmer from having to decide which values need to be exact, and which
can be approximated (and by how much).
It is important however to be able to control expression evaluation to
some extent, as when coding multiple-precision floating-point using the
two-sum idiom and the like to implement distill operations. (At various
points those were required as primitives, but we (the P754 WG) had trouble
agreeing on the details, and they were finally dropped.) Most languages
do have some form of requiring that parentheses be honoured strictly, or
that expression combining across several statements be inhibited, so as
to permit those idioms to survive being optimised to no-ops. THIS LEVEL
of local reproducibility is something that we should indeed require to
be available; langauges would still decide how the distinction is made.
Indeed, with respect to Fortran, Florent wrote:
Finally, and this may come as a shock to some, we could also use
Fortran: the Fortran standard states that (executive summary again)
"the compiler may do whatever expression rewriting it considers
"mathematically equivalent", but if the user has written parentheses
he shall respect them".
Florent's other example was LHC@Home, where bit-for-bit reproducibility
was essential. Again, this does not require that all languages support
a global reproducibility mode, because the professional programmer who
designs the program needing bit-for-bit reproducibility would be willing
to write in a subset that makes reproducibility possible. This does
require the language to make such a subset available. That can however
be achieved by documenting which programming idioms and compiler options
should be used or avoided. It would rarely boil down to something as
primitive (though easy to describe) as a "reproducible" attribute to be
attached to a block that could contain anything.
The net of this is: yes, control over reproducibility is desirable, but
both user and provider have to cooperate to achieve it: the provider, by
means of control options and documentation of idioms that can or cannot
guarantee reproducibility, and the user by programming in the subset for
which reproducibility CAN be guaranteed.
Happy Bastille Day, Florent!
Michel.
Sent: 2007-07-15 01:54:15 UTC