#10075: Make log gamma symbolic
---------------------------+------------------------------------------------
   Reporter:  kcrisman     |          Owner:  burcin       
       Type:  enhancement  |         Status:  needs_review 
   Priority:  major        |      Milestone:  sage-5.0     
  Component:  symbolics    |       Keywords:  sd35.5       
Work_issues:               |       Upstream:  N/A          
   Reviewer:               |         Author:  Karen T. Kohl
     Merged:               |   Dependencies:               
---------------------------+------------------------------------------------

Comment(by kcrisman):

 > Apparently this is how MPFR deals with this function.  So maybe all is
 well?

 I mean, for this ticket.  Though we should not claim that it is evaluated
 by Ginac, because it isn't (all the above is in Sage with or without this
 patch).

 Believe it [http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29335 or not]:
 {{{
 Not any negative value, but in lngamma.c:

   /* if x < 0 and -2k-1 <= x <= -2k, then lngamma(x) = NaN */

 probably because the gamma value is negative. This is because MPFR defines
 lngamma as log(gamma(x)) while the C standard defines it as log|gamma(x)|.
 I
 wonder if this should be regarded as a bug or if a new function (say,
 mpfr_lgamma) should be defined in MPFR (in which case, not before 2.3.0).
 Do
 other standards (other languages) define such a function, either as
 log(gamma(x)) or as log|gamma(x)|?
 }}}

 I'm cc:ing Paul Z. just to confirm that this is intended MPFR behavior.
 We should then open another ticket to make sure to use mpmath or ginac or
 something to get complex answers.    We currently somehow use PARI to get
 the complex versions.
 {{{
 sage: log_gamma(CC(-2.1))
 1.53171380819509 + 3.14159265358979*I
 sage: from sage.misc.citation import get_systems
 sage: get_systems('log_gamma(CC(-2.1))')
 ['PARI', 'MPFR']
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10075#comment:10>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to