id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
10849,behaviour of gamma strangely sensitive,dsm,burcin,"Whether you get the correct result or a spurious ValueError in evaluating some gamma expressions depends upon things it shouldn't.
This comes from [http://groups.google.com/group/sage-support/browse_thread/thread/3b7126c1a29db091# a sage-support thread]; I looked and couldn't find it here, but possibly it's a duplicate. (I have bad luck with trac.)
See also [http://demo.sagenb.org/home/pub/66/ this worksheet].
Here's a relatively simple test case, in 4.6.1 and 4.6.2.rc0:
{{{
sage: x = var(""x"")
sage: f = exp(gamma(I*x-1/2).subs(x=I*x))
sage: g=f.operands()[0]
sage: g, type(g)
(gamma(-x - 1/2), )
sage: g(x=0)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/Applications/sage_devel/ in ()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.__call__ (sage/symbolic/expression.cpp:15657)()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/ring.so in sage.symbolic.ring.SymbolicRing._call_element_ (sage/symbolic/ring.cpp:6537)()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.substitute (sage/symbolic/expression.cpp:15036)()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/pynac.so in sage.symbolic.pynac.py_doublefactorial (sage/symbolic/pynac.cpp:9463)()
ValueError: argument must be >= -1
sage: g(x=0)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[ ... duplicate removed; this is merely to show it's not only the first call which has problems ]
ValueError: argument must be >= -1
sage: gamma(-x-1/2)*g
gamma(-x - 1/2)^2
sage: g(x=0)
-2*sqrt(pi)
}}}
That is, merely performing the should-be-irrelevant ""gamma(-x-1/2)*g"" op makes g(x=0) start working. Instrumenting it shows that that py_doublefactorial gets a -3 the first time instead of the 1 it does the second time, but I couldn't quite follow the calling order to isolate the error.
Apply [attachment:trac_10849-doctests-on_9880.patch]",defect,closed,major,sage-6.2,symbolics,fixed,doctest,kcrisman,,Burcin Erocal,Ralf Stephan,N/A,,79a0ebda9d793ed3730584d522d8a5ba0c71ee26,79a0ebda9d793ed3730584d522d8a5ba0c71ee26,"#7160, #9880",