> Sorry for the large example, but smaller examples seem to work.
After some reductions, I think we can find a slightly simpler failure,
of a somewhat suspicious size (4.6.1, OS X 10.6):
q = var('q')
for i in [1..33]:
ix = 2**i
f=(q+1)/(q^(ix) + 1)
res = (f.series(q==0,2), f.subs(q=0), f.taylor(q, 0, 2))
print i, ix, res
1 2 (1 + 1*q + Order(q^2), 1, -q^2 + q + 1)
2 4 (1 + 1*q + Order(q^2), 1, q + 1)
3 8 (1 + 1*q + Order(q^2), 1, q + 1)
4 16 (1 + 1*q + Order(q^2), 1, q + 1)
[...]
28 268435456 (1 + 1*q + Order(q^2), 1, q + 1)
29 536870912 (1 + 1*q + Order(q^2), 1, q + 1)
30 1073741824 (1 + 1*q + Order(q^2), 1, q + 1)
31 2147483648 (Order(q^(-2147483646)), 1, q + 1)
32 4294967296 (1 + 1*q + Order(q^2), 1, q + 1)
33 8589934592 (1 + 1*q + Order(q^2), 1, q + 1)
The case with q^(3^i) is even funnier:
18 387420489 (1 + 1*q + Order(q^2), 1, q + 1)
19 1162261467 (1 + 1*q + Order(q^2), 1, q + 1)
20 3486784401 (Order(q^2), 1, q + 1)
21 10460353203 (1 + 1*q + Order(q^2), 1, q + 1)
22 31381059609 (1 + 1*q + Order(q^2), 1, q + 1)
23 94143178827 (Order(q^2), 1, q + 1)
24 282429536481 (Order(q^2), 1, q + 1)
25 847288609443 (1 + 1*q + Order(q^2), 1, q + 1)
26 2541865828329 (Order(q^2), 1, q + 1)
27 7625597484987 (1 + 1*q + Order(q^2), 1, q + 1)
28 22876792454961 (1 + 1*q + Order(q^2), 1, q + 1)
29 68630377364883 (1 + 1*q + Order(q^2), 1, q + 1)
30 205891132094649 (Order(q^2), 1, q + 1)
31 617673396283947 (1 + 1*q + Order(q^2), 1, q + 1)
32 1853020188851841 (Order(q^2), 1, q + 1)
33 555906056623 (Order(q^2), 1, q + 1)
Obvious suspect is overflow due to use of a C int somewhere along the
path (suddenly negative around 2^31; works for small numbers; is
better-behaved for powers of 2; can generate an actual OverflowError
at large enough exponents.)
Doug
--
Department of Earth Sciences
University of Hong Kong
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org