- View SourceOn 08/02/2009 05:31 PM, Kelly Jones wrote:
> Consider this frink program:

Kelly,

>

> x = new interval[-1,1]

> y = new interval[-1,1]

> println[x-y]

> println[x-x]

>

> The results are:

>

> [-2, 2]

> [-2, 2]

>

> The first one makes sense: subtracting a number between -1 and 1 from

> another number between -1 and 1 yields a number between -2 and 2.

>

> Is the second one correct? Subtracting a number between -1 and 1 from

> itself should yield 0, no? Thus, the second answer should be [0,0],

> no?

This is addressed (in some detail) in the FAQ:

http://futureboy.us/frinkdocs/faq.html#WhenXIsAnInterval

Please note again that there have been changes in the 2009-07-19

release of Frink that affect this behavior. Since this update, some

expressions (notably x/x and sometimes x-x) will be symbolically

simplified, which may change your results and give you tighter bounds.

Note that the programmer is still always encouraged to pre-simplify

symbolic expressions when it makes sense.

--

Alan Eliasen

eliasen@...

http://futureboy.us/ - View SourceOn 08/04/2009 01:15 AM, Alan Eliasen wrote:
> Please note again that there have been changes in the 2009-07-19

When thinking about this issue, I noticed that x-x can be simplified

> release of Frink that affect this behavior. Since this update, some

> expressions (notably x/x and sometimes x-x) will be symbolically

> simplified, which may change your results and give you tighter bounds.

> Note that the programmer is still always encouraged to pre-simplify

> symbolic expressions when it makes sense.

a bit more aggressively than it was before; the current (2009-08-04)

release of Frink has this simplification. Thanks for the comments and

questions!

--

Alan Eliasen

eliasen@...

http://futureboy.us/ - View SourceOn 08/04/2009 01:48 AM, Alan Eliasen wrote:
> On 08/04/2009 01:15 AM, Alan Eliasen wrote:

This change turned out to be overly aggressive, and the changes were

>> Please note again that there have been changes in the 2009-07-19

>> release of Frink that affect this behavior. Since this update, some

>> expressions (notably x/x and sometimes x-x) will be symbolically

>> simplified, which may change your results and give you tighter bounds.

>> Note that the programmer is still always encouraged to pre-simplify

>> symbolic expressions when it makes sense.

>

> When thinking about this issue, I noticed that x-x can be simplified

> a bit more aggressively than it was before; the current (2009-08-04)

> release of Frink has this simplification. Thanks for the comments and

> questions!

removed. If you downloaded Frink earlier today, I'd recommend getting

the current version.

===========================

Technical Explanation: Many normal algebraic simplifications

*cannot* be performed on many of the data types used in Frink. For example:

* Intervals are not distributive. That is a(b+c) does not

necessarily equal (ab + ac)!

* If you want to preserve and check units of measure through all

calculations, you *cannot* perform some mathematical simplifications like

0 * x = 0

or

x + 0 = x

As these transformations will lose information about the units of

measure that may someday be contained in the variable x, or cause units

with different units of measure to be added to each other.

* Date/Time math cannot use some of these transformations. For

example, when subtracting dates, one normally obtains the duration

between those dates (say, in seconds.) However, if doing a

transformation like:

x - x = 0

the result comes out dimensionless, and *not* a duration. (This

case caused obvious errors in the change I checked in last night.)

--

Alan Eliasen

eliasen@...

http://futureboy.us/