Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1419 from raoulb/gruntz_test_fix

Fix wrong test in Gruntz tests
  • Loading branch information...
commit fb35324a3d2811b5d2966b6c8b53d40398265dda 2 parents 4a7cbe6 + f9e49fe
@ness01 ness01 authored
Showing with 43 additions and 20 deletions.
  1. +43 −20 sympy/series/tests/test_gruntz.py
View
63 sympy/series/tests/test_gruntz.py
@@ -25,45 +25,68 @@ def sskip():
def test_gruntz_evaluation():
# Gruntz' thesis pp. 122 to 123
+ # 8.1
assert gruntz(exp(x)*(exp(1/x-exp(-x))-exp(1/x)), x, oo) == -1
+ # 8.2
+ assert gruntz(exp(x)*(exp(1/x+exp(-x)+exp(-x**2)) \
+ - exp(1/x-exp(-exp(x)))), x, oo) == 1
+ # 8.3
+ assert gruntz(exp(exp(x-exp(-x))/(1-1/x)) - exp(exp(x)), x, oo) == oo
+ # 8.5
+ assert gruntz(exp(exp(exp(x+exp(-x)))) / exp(exp(exp(x))), x, oo) == oo
+ # 8.6
+ assert gruntz(exp(exp(exp(x))) / exp(exp(exp(x-exp(-exp(x))))),
+ x, oo) == oo
+ # 8.7
+ assert gruntz(exp(exp(exp(x))) / exp(exp(exp(x-exp(-exp(exp(x)))))),
+ x, oo) == 1
+ # 8.8
+ assert gruntz(exp(exp(x)) / exp(exp(x-exp(-exp(exp(x))))), x, oo) == 1
+ # 8.9
+ 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
+ # 8.10
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
+ # 8.11
+ assert gruntz((exp(x*exp(-x)/(exp(-x)+exp(-2*x**2/(x+1)))) - exp(x))/x,
+ x, oo) == -exp(2)
+ # 8.12
assert gruntz((3**x + 5**x)**(1/x), x, oo) == 5
+ # 8.13
+ assert gruntz(x/log(x**(log(x**(log(2)/log(x))))), x, oo) == oo
+ # 8.14
+ assert gruntz(exp(exp(2*log(x**5+x)*log(log(x))))
+ / exp(exp(10*log(x)*log(log(x)))), x, oo) == oo
+ # 8.15
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
+ # 8.16
+ 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
+ # 8.17
assert gruntz(exp(x*exp(-x)/(exp(-x)+exp(-2*x**2/(x+1))))/exp(x), x, oo) \
== 1
+ # 8.19
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(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
+ # 8.20
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(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(x-exp(-x))/(1-1/x)) - 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((exp(x*exp(-x)/(exp(-x)+exp(-2*x**2/(x+1)))) - exp(x))/x,
- x, oo) == -exp(2)
- assert gruntz(exp(exp(x)) / exp(exp(x-exp(-exp(exp(x))))), x, oo) == 1
- assert gruntz(exp(exp(exp(x+exp(-x)))) / exp(exp(exp(x))), x, oo) == oo
- assert gruntz(exp(exp(exp(x+exp(-x)))) / exp(exp(x)), x, oo) == 1
- assert gruntz(exp(exp(exp(x))) / exp(exp(exp(x-exp(-exp(exp(x)))))),
- x, oo) == 1
+ # Another
+ assert gruntz(exp(exp(exp(x+exp(-x)))) / exp(exp(x)), x, oo) == oo
def test_gruntz_evaluation_slow():
sskip()
+ # 8.4
+ assert gruntz(exp(exp(exp(x)/(1-1/x)))
+ - exp(exp(exp(x)/(1-1/x-log(x)**(-log(x))))), x, oo) == -oo
+ # 8.18
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
- assert gruntz(exp(exp(exp(x)/(1-1/x)))
- - exp(exp(exp(x)/(1-1/x-log(x)**(-log(x))))), x, oo) == -oo
def test_gruntz_eval_special():
# Gruntz, p. 126
Please sign in to comment.
Something went wrong with that request. Please try again.