Comment #1 on issue 2136 by asmeurer: polygamma expansion problems
http://code.google.com/p/sympy/issues/detail?id=2136
Well, one doesn't have to substitute in values to see that this is messed
up:
In [1]: polygamma(0, 2*x).expand(func=True)
Out[1]: log(2) + polygamma(0, 2⋅x)
Clearly there is no such thing as an x such that x = x + log(2).
There are more problems:
In [2]: polygamma(2, 2*x).expand(func=True)
…
RuntimeError: maximum recursion depth exceeded while calling a Python object
I think what it is trying to do is apply the relations from the "Recurrence
relation" and "Multiplication Theorem" sections of the Wikipedia article
(http://en.wikipedia.org/wiki/Polygamma). But it doesn't seem to be
applying the n/k part correctly (the answer for the first one should be
In [19]: ((polygamma(0, x) + polygamma(0, x + S(1)/2)) + 2*log(2))/2
Out[19]:
polygamma(0, x) polygamma(0, 1/2 + x)
─────────────── + ───────────────────── + log(2)
2 2
In [21]: (((polygamma(0, x) + polygamma(0, x + S(1)/2)) +
2*log(2))/2).subs(x, 1).evalf()
Out[21]: 0.422784335098467
In [22]: N(polygamma(0, 2))
Out[22]: 0.422784335098467
So obviously that code needs some fixing. The polygamma function could do
with a docstring too.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.