autodiff.reverse.tan¶
- autodiff.reverse.tan(x)¶
Return the tangent of x.
- Parameters
- xint, float, Node
- Returns
- yfloat or Node
Notes
The derivative of tan(x) is undefined when the cosine of x is zero.
Examples
>>> ad.tan(np.pi / 4) 1.0
>>> x = ad.Node(np.pi / 4) >>> ad.tan(x) Node(1.0)
Derivative undefined:
>>> x = ad.Node(np.pi / 2) >>> ad.tan(x) Traceback (most recent call last): ... ValueError: Derivative of tan(x) is undefined for x = 1.5707963267948966