Status: Accepted
Owner: ness...@googlemail.com
Labels: Type-Defect Priority-Medium

New issue 2387 by ness...@googlemail.com: Evalf of trig functions with imaginary arguments
http://code.google.com/p/sympy/issues/detail?id=2387

In [1]: cosh(sqrt(I+0.5)).n()
Out[1]:
    ⎛  ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎞
cosh⎝╲╱ 0.5 + ⅈ ⎠

Similarly for other trig functions.

The following one-line patch solves this:

--- a/sympy/core/power.py
+++ b/sympy/core/power.py
@@ -539,6 +539,9 @@ def _eval_derivative(self, s):
return self * (dexp * C.log(self.base) + dbase * self.exp/self.base)

     def _eval_evalf(self, prec):
+        return self.evalf(prec)
+    '''
+    def _eval_evalf(self, prec):
         base, exp = self.as_base_exp()
         base = base._evalf(prec)
         if not exp.is_Integer:
@@ -547,6 +550,7 @@ def _eval_evalf(self, prec):
base = base.conjugate() / (base * base.conjugate())._evalf(prec)
             exp = -exp
         return Pow(base, exp).expand()
+    '''


[evalf() caters for Pow on its own], but this hardly seems like "the rigth way" :D.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to