#12521: evaluate log gamma for complex input
------------------------------------+---------------------------------------
       Reporter:  kcrisman          |         Owner:  AlexGhitza
           Type:  defect            |        Status:  new       
       Priority:  critical          |     Milestone:  sage-5.11 
      Component:  basic arithmetic  |    Resolution:            
       Keywords:  lgamma log_gamma  |   Work issues:            
Report Upstream:  N/A               |     Reviewers:            
        Authors:                    |     Merged in:            
   Dependencies:                    |      Stopgaps:            
------------------------------------+---------------------------------------

Comment (by eviatarbach):

 Paul, could you please comment on this code for
 `sage/rings/real_mpfr.pyx`?


 {{{
     def log_gamma(self):
         cdef RealNumber x = self._new()
         cdef int sign
         parent = (<RealField_class>self._parent)
         if parent.__prec > SIG_PREC_THRESHOLD: sig_on()
         mpfr_lgamma(x.value, &sign, self.value, parent.rnd)
         if parent.__prec > SIG_PREC_THRESHOLD: sig_off()
         if not mpfr_sgn(self.value) < 0:
             return x
         cdef RealNumber v = self._new()
         mpfr_div_si((<RealNumber>v).value, self.value, 2, parent.rnd)
         return parent.complex_field()(x, parent.pi() *
                                       (2 * (v - 1).ceil() + 1))
 }}}

 This correctly computes the principal branch. However, I'm concerned about
 precision; the result of `lgamma` is presumably guaranteed to be correct
 up to the precision of the input, but after doing some arithmetic it might
 not be. Is there any way to fix this?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12521#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 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.


Reply via email to