Open mezzarobba opened 2 years ago
Looks like some sort of problem with limit
and psi
:
sage: expr = (1/gamma(x)).diff(2)(x=2/5); expr
psi(2/5)^2/gamma(2/5) - psi(1, 2/5)/gamma(2/5)
sage: expr.limit(x=42)
Traceback (most recent call last):
...
RuntimeError: Encountered operator mismatch in maxima-to-sr translation
sage: psi(x).limit(x=42)
-euler_gamma + 85691034670497533/19914562703599200
sage: psi(x).limit(x=2/5)
Traceback (most recent call last):
...
RuntimeError: Encountered operator mismatch in maxima-to-sr translation
sage: psi(2/5).limit(x=42)
Traceback (most recent call last):
...
RuntimeError: Encountered operator mismatch in maxima-to-sr translation
Nevertheless, the following works
sage: f=psi(x)
sage: maxima(f).limit(x,5/4).sage()
-euler_gamma - 1/2*pi - 3*log(2) + 4
sage: maxima(f).limit(x,6/5).sage()
-euler_gamma - 1/4*(sqrt(5) + 1)*log(1/2*sqrt(5) + 5/2) + 1/4*(sqrt(5) - 1)*log(-1/2*sqrt(5) + 5/2) - 1/10*pi*sqrt(10*sqrt(5) + 25) - log(5) + 5
and
sage: maxima(f).limit(x,2/5)
(2*cos((8*%pi)/5)*log(2-2*cos((4*%pi)/5)) +2*cos((4*%pi)/5)*log(2-2*cos((2*%pi)/5))-%pi*cot((2*%pi)/5)-2*log(5) -2*%gamma) /2
sage: maxima(f).limit(x,2/5).sage()
-euler_gamma + 1/4*(sqrt(5) - 1)*log(1/2*sqrt(5) + 5/2) - 1/4*(sqrt(5) + 1)*log(-1/2*sqrt(5) + 5/2) - 1/10*pi*sqrt(-10*sqrt(5) + 25) - log(5)
trying to pinpoint the issue, one finds
sage: from sage.interfaces.maxima_lib import *
sage: bad = maxima_eval('((%COT SIMP) ((MTIMES SIMP) ((RAT SIMP) 1 5) $%PI))')
sage: max_to_sr(bad)
and then
ipdb> p maxima(expr)
cot(%pi/5)
ipdb> p expr
<ECL: ((%COT SIMP) ((MTIMES SIMP) ((RAT SIMP) 1 5) $%PI))>
ipdb> p SR(maxima(expr))
1/5*sqrt(10*sqrt(5) + 25)
so this is an issue of not recognizing the baby after it has been simplified...
CC: @cheuberg @behackl @dkrenn
Component: asymptotic expansions
Issue created by migration from https://trac.sagemath.org/ticket/34028