Incorrect gradient in divide_no_nan and reciprocal_no_nan when divide by 0
@drewshark,
Could you please confirm whether the above mentioned issue was raised when `tf.math.divide_no_nan and tf.math.reciprocal_no_nan` were trying to use **tf.test.compute_gradient**? or by default it is providing the incorrect gradient? Thank you! @tilakrayal,
I think the issue raises when these two APIs were trying to use **tf.test.compute_gradient** to calculate the numerical gradient.
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

binary

### Tensorflow Version

tf-nightly

### Custom Code

Yes

### OS Platform and Distribution

Ubuntu 20.04

### Mobile device

_No response_

### Python version

3.10.11

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

When we perform divide by zero in `tf.math.divide_no_nan` and `tf.math.reciprocal_no_nan`, the theoretical and numerical gradient given by `tf.test.compute_gradient` do not match. However, if the input is valid (without dividing by zero), the gradients are fine.

More examples in [gist here](https://colab.research.google.com/drive/1U102ToL3El9wHduuDyjQXtpsZkaByDg5?usp=sharing)

### Standalone code to reproduce the issue

```shell
import tensorflow as tf
x = tf.constant([10.0, 20.0])
y = tf.constant([2.0, 0.0])
th, nu= tf.test.compute_gradient(tf.math.divide_no_nan, [x, y])
print(th)
print(nu)
print(tf.experimental.numpy.allclose(th, nu, atol=1e-3))


import tensorflow as tf
x = tf.constant([2.0, 0.0])
th, nu= tf.test.compute_gradient(tf.math.reciprocal_no_nan, [x])
print(th)
print(nu)
print(tf.experimental.numpy.allclose(th, nu, atol=1e-3))
```


### Relevant log output

```shell
(array([[0.5, 0. ],
       [0. , 0. ]], dtype=float32), array([[-2.5,  0. ],
       [-0. ,  0. ]], dtype=float32))
(array([[0.5, 0. ],
       [0. , 0. ]], dtype=float32), array([[-2.5002441e+00,  0.0000000e+00],
       [ 0.0000000e+00,  2.0971520e+07]], dtype=float32))
tf.Tensor(False, shape=(), dtype=bool)



(array([[-0.25,  0.  ],
       [-0.  ,  0.  ]], dtype=float32),)
(array([[-2.500000e-01,  0.000000e+00],
       [ 0.000000e+00,  1.048576e+06]], dtype=float32),)
tf.Tensor(False, shape=(), dtype=bool)
```
</details>