You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calculates an implementation-dependent approximation to the tangent, having domain ``(-infinity, +infinity)`` and codomain ``(-infinity, +infinity)``, for each element ``x_i`` of the input array ``x``. Each element ``x_i`` is assumed to be expressed in radians.
1445
+
r"""
1446
+
Calculates an implementation-dependent approximation to the tangent for each element ``x_i`` of the input array ``x``.
1447
+
1448
+
Each element ``x_i`` is assumed to be expressed in radians.
1447
1449
1448
1450
**Special cases**
1449
1451
1450
-
For floating-point operands,
1452
+
For real-valued floating-point operands,
1451
1453
1452
1454
- If ``x_i`` is ``NaN``, the result is ``NaN``.
1453
1455
- If ``x_i`` is ``+0``, the result is ``+0``.
1454
1456
- If ``x_i`` is ``-0``, the result is ``-0``.
1455
1457
- If ``x_i`` is either ``+infinity`` or ``-infinity``, the result is ``NaN``.
1456
1458
1459
+
For complex floating-point operands, special cases must be handled as if the operation is implemented as ``-1j * tanh(x*1j)``.
1460
+
1461
+
.. note::
1462
+
Tangent is an analytical function on the complex plane and has no branch cuts. The function is periodic, with period :math:`\pi j`, with respect to the real component and has first order poles along the real line at coordinates :math:`(\pi (\frac{1}{2} + n), 0)`. However, IEEE 754 binary floating-point representation cannot represent the value :math:`\pi / 2` exactly, and, thus, no argument value is possible for which a pole error occurs.
1463
+
1464
+
.. note::
1465
+
For complex arguments, the mathematical definition of tangent is
where :math:`\operatorname{tanh}` is the hyperbolic tangent.
1471
+
1457
1472
Parameters
1458
1473
----------
1459
1474
x: array
1460
-
input array whose elements are expressed in radians. Should have a real-valued floating-point data type.
1475
+
input array whose elements are expressed in radians. Should have a floating-point data type.
1461
1476
1462
1477
Returns
1463
1478
-------
1464
1479
out: array
1465
-
an array containing the tangent of each element in ``x``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
1480
+
an array containing the tangent of each element in ``x``. The returned array must have a floating-point data type determined by :ref:`type-promotion`.
0 commit comments