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

Re: General pow(xx,yy) function in Motion 10



Dan Zuras Intervals wrote:
Date: Sat, 05 Dec 2009 16:36:16 -0500
To: stds-1788                           <stds-1788@xxxxxxxxxxxxxxxxx>
From: Michel Hack
<hack@xxxxxxxxxxxxxx> Subject: Re: General pow(xx,yy) function in
Motion 10

Hossam Fahmy caught my blunder:
I do see an issue however in the case where yy is a singleton,
because that is now an exponent with an even denominator (in both
decimal and binary) if it has a non-zero fractional part.

Decimal is not similar to binary in this respect.

Right; I just didn't think straight.  Sorry.

Michel.
---Sent: 2009-12-05 21:40:12 UTC

And, of course, this applies even to binary when yy is a
singleton integer for the denominator is 1 in that case. :-)

It is the odd integers that produce the negative results
in case of xx < 0, the even integers produce positive
results, & both cases will probably be sent to one of
the other pow's in any practical implementation.

But things like this & many others are kind of the idea
behind a generalized pow, no?

The pow that covers all cases & contains all solutions.


In principle, I follow that reasoning.

In practice, a particular scenario I have concern about is this:

If I understand correctly, in a branch-and-bound algorithm when xx is
negative the interval range will not contract even as the domain is
bisected... at least until the domain is bisected to a singleton value
(where it might be undefined). In either case, it is possible this could
lead to stack overflow and system crash.

With careful exception handling, I agree it should be possible to avoid such
an outcome. However, this also requires foresight and planning on behalf of
the unwary interval user. So is it really an improvement over requiring the
user to choose ahead of time between exp(y*ln(x)) vs. powr(x,m,n), etc.?

All else being equal, I suspect many interval users would choose general pow
because they see it as being easy to use. But then be suprised that their
branch-and-bound program crashed.

Nate