Here is what I get in master: In [2]: O(x) + O(exp(1/x)) Out[3]: O(exp(1/x))
In [4]: O(exp(1/x)) + O(x) Out[4]: O(exp(1/x)) Can someone explain to me why O(x + exp(1/x)) = O(exp(1/x))? It seems to me that it should be O(x), since exp(1/x) is a decreasing function, so it should be O(1) (see plots at http://www.wolframalpha.com/input/?i=exp(1/x)). Aaron Meurer On Sep 2, 2010, at 2:28 PM, smichr wrote: > I'm trying to modify sympy to retain the restriction on log(exp(arg)) > applying to only real args. I have most things worked out but have a > curious problem with Order where the order of addition is affecting > the result. > > ________________ sympy\series\tests\test_order.py:test_simple_6 > ________________ > > File "c:\documents and settings\chris\sympy\sympy\series\tests > \test_order.py", > line 53, in test_simple_6 > assert Order(x)+Order(exp(1/x)) == Order(exp(1/x)) > AssertionError > ________________________________________________________________________________ > > _______________ sympy\series\tests\test_order.py:test_contains_1 > _______________ > > File "c:\documents and settings\chris\sympy\sympy\series\tests > \test_order.py", > line 74, in test_contains_1 > assert not Order(x).contains(Order(exp(1/x))) > AssertionError > > ============= tests finished: 24 passed, 2 failed, in 0.94 seconds > ============= > > DO *NOT* COMMIT! > C:\Documents and Settings\chris>\py > > > > Here, I show the problem: > > > C:\Documents and Settings\chris>\python26\python.exe > Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit > (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> from sympy import * >>>> var('x') > x >>>> Order(x) > O(x) >>>> Order(exp(1/x)) > O(exp(1/x)) >>>> _+O(x) <<<----adding on the right > O(exp(1/x)) >>>> O(x)+_ <<<----adding on the left gives a different result > O(x) > > Does anyone have an idea why this might be happening? > > If you want to take a look, this is in my "2 failing..." commit > a9856fe in t2 at github/smichr > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
