Progress on if-then-else



The range of x and the range of the expression are reduced monotonically until the greatest fixed point is reached.

All functions take only real arguments & produce only real results.  So sqrt(-3) is literally _undefined_: the domain of sqrt is [0,inf).

Let x,y range over (minf,inf).  Then x*y ranges over (minf,inf), -x*y ranges over (minf,inf), 1-x*y ranges over (minf,inf).
sqrt(1-x*y) ranges over [0,inf).  [sqrt(1-x*y) might blow up if sqrt's argument is negative, but sqrt will never return a negative number.]

When I get a floating point number x, I assume that it is irrational, and compute an upper & lower rational bound on x, so that x
is in (lower,upper).  Thus, I allow for a certain amount of "fuzz" with floating point numbers.

This "fuzz" is required so that x is always in f^(-1)(f(x)) and y is always in f(f^(-1)(y)), for functions like exp, log, sqrt, etc.

My algorithm even produces _fractal_ ranges, e.g.,

(x+1/x)=2

x ranges over (minf,0)(0,1/2)(1/2,2/3)(2/3,3/4)(3/4,4/5)(4/5,5/6), etc.

i.e., the domain (minf,inf) has been punctured at 0,1/2,2/3,3/4,4/5,5/6,...

Obviously, this range cannot be represented with a finite number of atomic intervals.

It's not clear what to do about this, since we want to produce a fixed point, but perhaps not the least fixed point (which would mean solving the equation to produce x=1).  Our algorithm is a particularly poor method for solving this equation!

At 04:23 PM 3/7/2013, Raymond Toy wrote:
>>>>>> "Henry" == Henry Baker <hbaker1 at pipeline.com> writes:
>
>    Henry> Using my range analysis program:
>    Henry> Given: sqrt(1-sqr(x))
>
>    Henry> where sqr(x) is x^2, we conclude that the result is in the
>    Henry> range [0,1], and x must be in the range [-1,1].
>
>So you're saying if we know that sqrt(1-sqr(x)) is in [0, 1], then x
>must be in [-1, 1]?  That makes sense to me.
>
>    Henry> Given: sqrt(1-x*x)
>
>    Henry> we conclude that the result is in the range [0,inf), and x
>    Henry> must be in the range (minf,inf).  [Note that x*x is not the
>    Henry> same as x^2, because x*x is a binary operation on two
>    Henry> arguments that happen to be the same ranges, while x^2 is a
>    Henry> unary operation on a single range.]
>
>This I don't understand.  How can sqrt(1-x*x) be in the range [0,
>inf)?  If x is in the range (minf, inf), then x*x is (minf, inf)
>(assuming the x's are different) and 1 - x*x is (minf, inf).  The sqrt
>would then be some complex result union [0, inf).  Is that what you mean?
>
>    Henry> Given: (exp(x)+exp(-x))/2 = 3
>
>    Henry> we conclude that x is in the range (-30/17, 30/17), which
>    Henry> is pretty good, considering we don't know about acosh() !
>
>How do you derive that result?
>
>Ray