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

Re: A decorations question



John Pryce wrote:
P1788

First, I thank Dan for his explanation of some of the complexities of
designing fast hardware. Hopefully I've gained a better understanding
of busses, registers and deep pipes.

Here's a relatively simple Q. Or maybe not.

I am thinking about the Bounded attribute. Suppose I construct
 decorated interval datums xx = dinterval(0,2); //using dinterval to
mean "decorated interval constructor"
This produces interval [0,1] with Bounded attribute "isBounded",
 i.e., ignoring other decorations, xx holds ([0,2],B+)

Now it seems reasonable that
 uu = 1/xx;
should be unconditionally unbounded: uu holds ([1/2,+oo],B-).

But now suppose I do instead
 ww = dinterval(0,Pi/2).
Ignore for now the fact that Pi/2 isn't exactly representable: that's
not my point.
Then do
 xx = sin(ww)+cos(ww);
Both sin(ww) and cos(ww) come out as ([0,1],B+). So as before, xx
 holds ([0,2],B+). But now after uu = 1/xx;
there is NO sense in saying uu is unconditionally unbounded. This
 seems to be an attempt to enclose the range of 1/(sin(w) + cos(w))
as w ranges over [0,Pi/2]
which is [1/sqrt(2), 1] I think.


It is [1,2/sqrt(2)]






So it seems to me that in ALMOST ALL situations, we shouldn't flag
the result of an operation as "definitely unbounded".

Even if xx holds Entire,
 yy = tan(xx)
should in most cases be "possibly bounded".

Or am I taking a wrongheaded view of what Bounded "means"? What
"meaning" is appropriate here?

I think it is a good question to ask. But IMO these examples put focus on
the wrong culprit. What you are noticing in the first example is the scurge
of interval dependence.

Simple interval arithmetic does not recognize the interval dependence caused
by multiple occurences of the variable ww in the expression sin(ww)+cos(ww),
so this causes the pessimistic result [0,2] instead of [1,2/sqrt(2)].

Now, the arithmetic operation 1/[0,2], by itself, is unbounded, whereas
1/[1,2/sqrt(2)] is not.

If IEEE 1788 only dictates how computers must process individual interval
operations, then it seems to me the result must be 1/[0,2], which is
unbounded.

THe bounded result 1/[1,2/sqrt(2)] comes from a more sophisticated interval
analysis to overcome the interval dependence. This requires some minimal
amount of symbolic syntax analysis of the entire interval expression. For
example, I expect a Computer Algebra System to provide this answer, but not
a simple interval processor.

But another aspect of this example is much, much more interesting to me: the
fact that 1/[0,2] has the attribute "possiblyDefined" because 0 is an
element of [0,2] and 1/0 is undefined.

Most serious interval software does not rely on simple forward evaluation of
interval operations, since interval dependence causes pessimistic result
that are for all practical purposes useless.

At the very least, an interval analysis method like bisection will be used
to defeat pessimism and find narrow bounds to solutions. In this example,
1/(sin(ww)+cos(ww)) over the interval [0,PI/2] is "possiblyDefined".

Branch-and-bound algorithms should accept an "isDefined" result, reject a
"notDefined" result, and continue to bisect a "possiblyDefined" result. In
this case, [0,PI/2] can be bisected into [0,PI/4] and [PI/4,PI/2].

Now the expression 1/(sin(ww)+cos(ww)) evaluated over these two smaller
domains "isDefined."

This is an example why I wonder sometimes if the "Bounded" attribute is
really relevant.

Nate