<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/math/special.py#L52-L91) |

Difference of arctan(x) and arctan(y).

    tfp.math.atan_difference(
        x, y, name=None
    )

Computes arctan(x) - arctan(y) avoiding catastrophic cancellation. This is
by resorting to the identity:

    arctan(x) - arctan(y) = arctan((x - y) / (1 + x * y)) +
                            pi * sign(x) * 1_{x * y < -1)

where `1_A` is the indicator function on the set `A`.

For a derivation of this fact, see \[1\].

#### References

\[1\] De Stefano, Sum of Arctangents
<https://sites.google.com/site/micdestefano/mathematics/trigonometry/sum-of-arctangents>

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Floating-point Tensor. Should be broadcastable with `y`. |
| `y` | Floating-point Tensor. Should be broadcastable with `x`. |
| `name` | Optional Python `str` naming the operation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `z` | Tensor of same shape and dtype as `x` and `y`. |

<br />