[stdinterval] Outofdomain behavior
Gabriel Dos Reis
gdr at integrablesolutions.net
Mon Oct 9 21:08:02 PDT 2006
Guillaume Melquiond <guillaume.melquiond at enslyon.fr> writes:
[...]
 So the two solutions we are left with are:

 1. Using an explicit parameter:

 interval my_function(interval x, interval y, bool &f)
 { return divide(sqrt(x, f), 1. + sqrt(asin(x) + y, f), f); }

 2. Using an implicit (global) parameter:

 interval my_function(interval x, interval y)
 { return sqrt(x) / (1. + sqrt(asin(x) + y)); }

 The first solution has a clean semantic and it is vendorfriendly, as
 there is no side effect. The second solution is userfriendly, as it is
 more readable, less errorprone (have you noticed the mistake in the
 first version of my_function?), and probably more efficient.
In fact, my objection to global flags is precisely that it is NOT
userfriendly.
I believe framing the issue in terms of vendorfriendly
vs. userfriendly is not accurate enough to get us on track.
 Gaby
More information about the Stdinterval
mailing list