<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/keras-team/keras/tree/v3.15.1/keras/src/ops/math.py#L1138-L1157) |

Computes the error function of `x`, element-wise.

    tf.keras.ops.erf(
        x
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | Input tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor with the same dtype as `x`. ||

<br />

#### Example:

    x = np.array([-3.0, -2.0, -1.0, 0.0, 1.0])
    keras.ops.erf(x)
    array([-0.99998 , -0.99532, -0.842701,  0.,  0.842701], dtype=float32)