[std-interval] More on interval computations as proofs

Lawrence Crowl Lawrence at Crowl.org
Fri Sep 29 12:01:18 PDT 2006


Prof.Dr.J.Wolff von Gudenberg wrote:
> We propose (together with G. Melquiond) That this flag can be
> managed by the user himself.  The elementary functions (at least
> those with bounded domain) have to set this flag in the case when
> the argument interval is not completely contained in the domain of
> the function interval<T> sqrt ( interval<T> x, bool& flag) will
> be a proper interface Such a function is also necessary for the
> division operator interval<T> divide ( interval<T> x, interval<T>
> y, bool& flag) interval<T> divide ( T x, interval<T>y, bool& flag)
> multiplication and addition are ok.

I hope you are proposing these operations in addition to the
corresponding operations without the flag.

On 9/29/06, Sylvain Pion <Sylvain.Pion at sophia.inria.fr> wrote:
> An alternative implementation is to have a global flag like errno,
> which allows to check the flag without modifying all function calls.
> What is the motivation behind your choice ?

Please, no.  Functions that modify global state are nightmares for
multithreaded code.  We could use thread-local storage, but that
still means the function has a side effect, and compilers cannot
optimize well around functions with side effects.  In addition,
without two different functions, the user has no way to say either
"I don't care about domain errors" or "I am quite sure there is no
domain error here".  The result is substantial overhead in fairly
primitive functions.

-- 
Lawrence Crowl


More information about the Std-interval mailing list