bug in series

42 views
Skip to first unread message

swd...@hotmail.ca

unread,
Jan 31, 2016, 11:00:32 AM1/31/16
to sympy
This is literally my first program using sympy, based on an example from my calculus class:

from sympy import *

def main():
    x=symbols("x")
    f=exp(x**3)*cos(x**6)
    print(series(f,x,0,14))
    print(series(f,x,0,19))

if __name__ == "__main__":
    main()

The output:

1 + x**3 + x**6/2 + x**9/6 + x**12/24 + O(x**14)
1 + x**3 + x**6/2 + x**9/6 - 11*x**12/24 - 59*x**15/120 - 179*x**18/720 + O(x**19)

As you can see at least one of the answers is wrong.
Should I bother using sympy a second time?

Ondřej Čertík

unread,
Jan 31, 2016, 12:14:33 PM1/31/16
to sympy
Hi Swdrury,
Thanks for reporting it. I created an issue for it here:

https://github.com/sympy/sympy/issues/10503

The series is pretty well tested, so I am surprised that there is a
bug like this. This needs to be fixed.

> Should I bother using sympy a second time?

We'll update the issue once this is fixed. If you find any other
issues, please let us know.

Thanks,
Ondrej

Denis Akhiyarov

unread,
Jan 31, 2016, 9:58:52 PM1/31/16
to sympy
omg has the patch
Reply all
Reply to author
Forward
0 new messages