From 9eafdee72e2d440a0ae9f7b47125a867a1524960 Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Fri, 25 Mar 2016 14:44:56 +0100 Subject: [PATCH] 20098: doctest fix for Re/Im(tanh) wrong formula --- src/sage/functions/hyperbolic.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/sage/functions/hyperbolic.py b/src/sage/functions/hyperbolic.py index e451fed340a..6589a7a444e 100644 --- a/src/sage/functions/hyperbolic.py +++ b/src/sage/functions/hyperbolic.py @@ -189,6 +189,19 @@ def __init__(self): sage: latex(tanh(x)) \tanh\left(x\right) + + Check that real/imaginary parts are correct (:trac:`20098`):: + + sage: tanh(1+2*I).n() + 1.16673625724092 - 0.243458201185725*I + sage: tanh(1+2*I).real().n() + 1.16673625724092 + sage: tanh(1+2*I).imag().n() + -0.243458201185725 + sage: tanh(x).real() + sinh(2*real_part(x))/(cos(2*imag_part(x)) + cosh(2*real_part(x))) + sage: tanh(x).imag() + sin(2*imag_part(x))/(cos(2*imag_part(x)) + cosh(2*real_part(x))) """ GinacFunction.__init__(self, "tanh", latex_name=r"\tanh")