Re: fwd from Jim Demmel: More on repeatability
On 2011-08-17 18:02:56 +0100, N.M. Maclaren wrote:
> On Aug 17 2011, Vincent Lefevre wrote:
> >>>IMHO, this should be done only by specifying the full behavior, possibly
> >>>depending on well-identified platform-dependent parameters. Otherwise it
> >>>may be tricky to define "repeatable mode" and "same machine" (e.g. what
> >>>if the machine is upgraded[*], some environment variables are changed,
> >>>and so on?)
> >>
> >>Once you do that for any non-trivial operation, you are forbidding any
> >>improvements in the future. State of the art today may be one result,
> >>but someone may develop an improvement.
> >
> >With forbidden contraction and in tightest mode, there would be
> >no possible improvements.
>
> Precisely. As has been pointed out, it is computationally infeasible
> to specify mathematically optimal bounds for most non-trivial operations,
This is not unfeasible. Correct rounding is what IEEE-754 recommends
and is implemented in some libraries. For some functions, the
termination cannot be proved, but this isn't much a problem in
practice (it is not proven that the hardware works correctly anyway,
so that this shouldn't prevent from implementing correct rounding).
The main problem can be the performance on some functions, e.g. for
sin/cos/tan on large arguments. One solution would be to return [-1,1]
for sin and cos when the argument is large enough. The threshold could
be specified by the user, so that reproducibility would be guaranteed.
> so such a specification has to be for the best achievable bounds with
> the technology at the time the specification is developed. Then someone
> develops a better algorithm, and the standard forbids an implementor
> to adopt it ....
No, the standard won't forbid it. It will just forbid to return an
*incorrect* result (w.r.t. reproducibility).
If you want very fast algorithms, you can still drop reproducibility
(which should only be optional).
--
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 / Arénaire project (LIP, ENS-Lyon)