pearu / sympycore

Automatically exported from code.google.com/p/sympycore
Other
11 stars 1 forks source link

canonization of expressions with extended numbers #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following are not working:
  oo*(1+x) -> oo*x
  oo*(2*x) -> oo*x

To get them working, is_bounded should return (bounded part, unknown part)
and get_directon() should return (direction part, unknown part).

Original issue reported on code.google.com by pearu.peterson on 13 Feb 2008 at 8:30

GoogleCodeExporter commented 9 years ago
Note that the first one is wrong for x = -1.

Original comment by fredrik....@gmail.com on 13 Feb 2008 at 8:46

GoogleCodeExporter commented 9 years ago
Right, so we should have
  oo*(1+x) -> oo + oo*x
or in more general,
  oo*(<direction part> + <unknown part>) -> oo*<direction> + oo*<unknow part>
For example,
  oo*(1-pi + x+y) -> -oo + oo*(x+y)

Original comment by pearu.peterson on 13 Feb 2008 at 9:05

GoogleCodeExporter commented 9 years ago
The example

    oo*(1-pi + x+y) -> -oo + oo*(x+y)

still does not work optimally. Consider substituting in x,y = 2: then lhs is oo 
but
rhs is nan.

So I think if oo is unable to eat all of the terms, it should eat none of them.

Original comment by fredrik....@gmail.com on 13 Feb 2008 at 9:12

GoogleCodeExporter commented 9 years ago
Great, this actually makes things simpler.

Original comment by pearu.peterson on 13 Feb 2008 at 9:30

GoogleCodeExporter commented 9 years ago
Current behaviour is:

>>> print oo*(1-pi + x+y)
oo*(1 + x + y - pi)

Original comment by pearu.peterson on 29 Feb 2008 at 1:19