Skip to content

Commit

Permalink
20098: doctest fix for Re/Im(tanh) wrong formula
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Mar 25, 2016
1 parent 930e35e commit 9eafdee
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sage/functions/hyperbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 9eafdee

Please sign in to comment.