Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined functions are assumed to be of sub-exponential growth at infinity #14156

Open
normalhuman opened this issue Feb 11, 2018 · 2 comments
Labels

Comments

@normalhuman
Copy link
Contributor

>>> x = symbols('x')
>>> f = Function('f')
>>> limit(f(x)/exp(x), x, oo)
0

The problem appears to be in the mrv function: mrv(f(x), x) declares x to be the most rapidly varying subexpression of f(x). It should raise NotImplementedError instead, since there is no way to tell how rapidly f(x) varies.

Some known functions indeed satisfy the condition that log|f(x)| / \log|x| has finite limit as x-> infinity, and for them the answer is correct.

This sort of thing is responsible for #13750 and probably #14072.

@normalhuman
Copy link
Contributor Author

In terms of Gruntz thesis (Definition 5.1), all functions are assumed to be tractable by mrv.

One can't use limit( log|f(x)| / log|x|) to test this, since doing so will lead to infinite recursion.

Should we decorate all the functions with "tractable"? Or intractable_at with a list of points where it is not tractable? Most functions are tractable at finite points (i.e., don't have essential singularities). Many are intractable at infinity, and some require different rewrites to become tractable at different infinite points.

I suspect any attempt to repair this will result in many limits that were previously evaluated correctly (by luck) being not evaluated anymore.

@normalhuman
Copy link
Contributor Author

My current idea is to use rewrite_as_tractable for this purpose. It should receive a hint indicating which variable tends to oo, and based on that, make a determination whether the function is tractable already (return None), or can be made tractable (return tractable form), or raise NotImplementedError. In particular, for undefined functions it should just raise NotImplementedError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant