id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,work_issues,upstream,reviewer,author,merged,dependencies,stopgaps
10072,Bug in log gamma evaluation,kcrisman,AlexGhitza,"When `log_gamma` is naively numerically evaluated, it seems to be wrong.
{{{
sage: log_gamma(i).n()
-0.0219785471672303 - 0.168184318273662*I
}}}
Pari gives this:
{{{
sage: log_gamma(pari(i))
-0.650923199301856 - 1.87243664726243*I
}}}
And in Sage's Maxima:
{{{
(%i3) ev(log_gamma(%i),numer);
(%o3)             - 1.872436647262428 %i - .6509231993018556
}}}
And in ginsh for Ginac 1.5.8:
{{{
> lgamma(I);
-0.65092319930185634056+4.41074865991715666*I
}}}
which is pretty clearly a different branch choice from Maxima and Pari (the complex part is exactly `2*pi` away from Maxima and Pari).

The relevant bit of code is
{{{
sage: a = log_gamma(i)
sage: a._convert(RealField(53).complex_field())
-0.0219785471672303 - 0.168184318273662*I
}}}
But I'm not sure if this problem is in Pynac or in the Sage complex field.",defect,closed,major,sage-4.6.1,basic arithmetic,fixed,,burcin zimmerma,,N/A,Paul Zimmermann,Flavia Stan,sage-4.6.1.alpha0,,
