#12521: evaluate log gamma for complex input
------------------------------------+---------------------------------------
Reporter: kcrisman | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.11
Component: basic arithmetic | Resolution:
Keywords: lgamma log_gamma | Work issues:
Report Upstream: N/A | Reviewers: Burcin Erocal
Authors: Eviatar Bach | Merged in:
Dependencies: | Stopgaps:
------------------------------------+---------------------------------------
Old description:
> Currently, we use MPFR or Ginac to evaluate `log_gamma`, but this returns
> `NaN` for negative input with even ceiling.
> {{{
> sage: log_gamma(-2.1)
> NaN
> sage: log_gamma(-3.1)
> 0.400311696703985
> sage: log_gamma(-4.1)
> NaN
> sage: log_gamma(-5.1)
> -2.63991581673655
> sage: log_gamma(-21/10).n()
> NaN
> sage: get_systems('log_gamma(-21/10).n()')
> ['ginac']
> sage: log_gamma(CC(-2.1))
> 1.53171380819509 + 3.14159265358979*I
> }}}
> We can use mpmath or something other trick to get this to work, now that
> #10075 has a nice symbolic function available. See #10072 for where we
> originally got better numerical evaluation.
> {{{
> sage: mpmath.loggamma(-2.1)
> mpc(real='1.5317138081950856', imag='-9.4247779607693793')
> }}}
> Putting as defect because there is a log gamma for negative numbers,
> though we should talk about branches...
>
> Apply: [attachment:trac_12521.2.patch]
New description:
Currently, we use MPFR or Ginac to evaluate `log_gamma`, but this returns
`NaN` for negative input with even ceiling.
{{{
sage: log_gamma(-2.1)
NaN
sage: log_gamma(-3.1)
0.400311696703985
sage: log_gamma(-4.1)
NaN
sage: log_gamma(-5.1)
-2.63991581673655
sage: log_gamma(-21/10).n()
NaN
sage: get_systems('log_gamma(-21/10).n()')
['ginac']
sage: log_gamma(CC(-2.1))
1.53171380819509 + 3.14159265358979*I
}}}
We can use mpmath or something other trick to get this to work, now that
#10075 has a nice symbolic function available. See #10072 for where we
originally got better numerical evaluation.
{{{
sage: mpmath.loggamma(-2.1)
mpc(real='1.5317138081950856', imag='-9.4247779607693793')
}}}
Putting as defect because there is a log gamma for negative numbers,
though we should talk about branches...
Apply: [attachment:trac_12521_3.patch]
--
Comment (by eviatarbach):
Why is the patchbot trying to apply the last two patches instead of just
trac_12521_3.patch?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12521#comment:17>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.