Status: Started
Owner: [email protected]
Labels: Type-Defect Priority-Medium ness987
New issue 2278 by [email protected]: gruntz is broken
http://code.google.com/p/sympy/issues/detail?id=2278
The current implementation of the gruntz algorithm is quite messed up and
broken. To see this, consider the following set of tests, taken from
Gruntz' thesis:
def test_gruntz_evaluation():
# Gruntz' thesis pp. 122 to 123
assert gruntz(exp(x)*(exp(1/x-exp(-x))-exp(1/x)), x, oo) == -1
assert gruntz(exp(exp(x-exp(-x))/(1-1/x)) - exp(exp(x)), x, oo) == oo
assert gruntz(exp(exp(exp(x)/(1-1/x)))
- exp(exp(exp(x)/(1-1/x-log(x)**(-log(x))))), x, oo) ==
-oo
assert gruntz(exp(exp(exp(x+exp(-x)))) / exp(exp(exp(x))), x, oo) == oo
assert gruntz(exp(exp(x)) / exp(exp(x-exp(-exp(exp(x))))), x, oo) == 1
assert gruntz((x*log(x)*(log(x*exp(x)-x**2))**2)
/ (log(log(x**2+2*exp(exp(3*x**3*log(x)))))), x, oo) ==
S(1)/3
assert gruntz((3**x + 5**x)**(1/x), x, oo) == 5
assert gruntz(exp(exp(S(5)/2*x**(-S(5)/7)+ S(21)/8*x**(S(6)/11)
+2*x**(-8)+S(54)/17*x**(S(49)/45) ))**8
/ log(log(-log(S(4)/3*x**(-S(5)/14))))**(S(7)/6), x, oo)
== oo
assert gruntz(exp(x*exp(-x)/(exp(-x)+exp(-2*x**2/(x+1))))/exp(x), x,
oo) \
== 1
assert gruntz(exp(exp(exp(x))) / exp(exp(exp(x-exp(-exp(exp(x)))))),
x, oo) == 1
assert gruntz((exp(4*x*exp(-x)/(1/exp(x)+1/exp(2*x**2/(x+1)))) - exp(x))
/ exp(x)**4, x, oo) == 1
assert gruntz(exp(exp(exp(x+exp(-x)))) / exp(exp(exp(x))), x, oo) == oo
assert gruntz(exp(exp(2*log(x**5+x)*log(log(x))))
/ exp(exp(10*log(x)*log(log(x)))), x, oo) == oo
assert gruntz(log(x)*(log(log(x)+log(log(x))) - log(log(x)))
/ (log(log(x)+log(log(log(x))))), x, oo) == 1
assert gruntz(x/log(x**(log(x**(log(2)/log(x))))), x, oo) == oo
assert gruntz((exp(x*exp(-x)/(exp(-x)+exp(-2*x**2/(x+1)))) - exp(x))/x,
x, oo) == -exp(2)
assert gruntz(log(x)**2 * exp(sqrt(log(x))*(log(log(x)))**2
* exp(sqrt(log(log(x))) * (log(log(log(x))))**3)) /
sqrt(x),
x, oo) == 0
assert gruntz(exp((log(log(x+exp(log(x)*log(log(x))))))
/ (log(log(log(exp(x)+x+log(x)))))), x, oo) == E
assert gruntz(exp(x)*(exp(1/x+exp(-x)+exp(-x**2)) \
- exp(1/x-exp(-exp(x)))), x, oo) == 1
assert gruntz((exp(exp(-x/(1+exp(-x))))*exp(-x/(1+exp(-x/(1+exp(-x)))))
*exp(exp(-x+exp(-x/(1+exp(-x))))))
/ (exp(-x/(1+exp(-x))))**2 - exp(x) + x, x, oo) == 2
Almost all of them either hang or return wrong answers.
This is because a) some series evaluation code does not respect the
requirements of the gruntz algorithm and b) a few implementation
shortcomings in gruntz.py.
I'm working on this but I feel like there should be an entry here as well
so if I loose interest this is not forgotten...
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" 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-issues?hl=en.