Define a valid interval for the `tan` function, so that: ``domain_tan(eps) = True`` where ``abs(cos(x)) < eps``
| 820 | |
| 821 | |
| 822 | class _DomainTan: |
| 823 | """ |
| 824 | Define a valid interval for the `tan` function, so that: |
| 825 | |
| 826 | ``domain_tan(eps) = True`` where ``abs(cos(x)) < eps`` |
| 827 | |
| 828 | """ |
| 829 | |
| 830 | def __init__(self, eps): |
| 831 | "domain_tan(eps) = true where abs(cos(x)) < eps)" |
| 832 | self.eps = eps |
| 833 | |
| 834 | def __call__(self, x): |
| 835 | "Executes the call behavior." |
| 836 | with np.errstate(invalid='ignore'): |
| 837 | return umath.less(umath.absolute(umath.cos(x)), self.eps) |
| 838 | |
| 839 | |
| 840 | class _DomainSafeDivide: |