#5556: symbolic gamma function and symbolic log function are incoherent
-----------------------+----------------------------------------------------
Reporter: ncalexan | Owner:
Type: defect | Status: new
Priority: critical | Milestone: sage-3.4.1
Component: symbolics | Keywords: symbolic gamma log function numerical
approximation
-----------------------+----------------------------------------------------
So this is incredibly awful:
{{{
sage: gamma(RealField(100)(3/4))
1.2254167024651776451290983034
sage: gamma(3/4).n(100)
1.2254167024651776429777783051
}}}
(for the record, the first one is correct)
and this doesn't agree with that:
{{{
sage: log(2).n(100)
0.69314718055994530941723212146
sage: log(RealField(2))
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/ncalexan/Devel/RiemannTheta/riemann_theta.py in <module>()
/Users/ncalexan/sage-3.4.rc0/local/lib/python2.5/site-
packages/sage/calculus/calculus.pyc in log(x, base)
9242 return x.log()
9243 except AttributeError:
-> 9244 return ln(x)
9245 else:
9246 try:
/Users/ncalexan/sage-3.4.rc0/local/lib/python2.5/site-
packages/sage/calculus/calculus.pyc in ln(x)
9189 0.693147180559945
9190 """
-> 9191 return function_log(x)
9192
9193 def log(x, base=None):
/Users/ncalexan/sage-3.4.rc0/local/lib/python2.5/site-
packages/sage/calculus/calculus.pyc in __call__(self, x, *args)
7542 return getattr(x, self._repr_())(*args)
7543 except AttributeError:
-> 7544 return SymbolicComposition(self, SR(x))
7545
7546 def _approx_(self, x): # must *always* be called with a float
x as input.
/Users/ncalexan/sage-3.4.rc0/local/lib/python2.5/site-
packages/sage/calculus/calculus.pyc in __call__(self, x)
504 msg, s, pos = err.args
505 raise TypeError, "%s: %s !!! %s" % (msg, s[:pos],
s[pos:])
--> 506 return self._coerce_impl(x)
507
508 def _coerce_impl(self, x):
/Users/ncalexan/sage-3.4.rc0/local/lib/python2.5/site-
packages/sage/calculus/calculus.pyc in _coerce_impl(self, x)
566 return self(x._sage_())
567 else:
--> 568 raise TypeError, "cannot coerce type '%s' into a
SymbolicExpression."%type(x)
569
570 def _repr_(self):
TypeError: cannot coerce type '<type 'sage.rings.real_mpfr.RealField'>'
into a SymbolicExpression.
sage: log(RealField(2))
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5556>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---