erf#

ivy.erf(x, /, *, out=None)[source]#

Compute the Gauss error function of x element-wise.

Parameters:
  • x (Union[Array, NativeArray]) – Value to compute exponential for.

  • out (Optional[Array]) – optional output array, for writing the result to. It must have a shape that the (default: None) inputs broadcast to.

Return type:

Array

Returns:

ret – The Gauss error function of x.

Examples

>>> x = ivy.array([0, 0.3, 0.7, 1.0])
>>> ivy.erf(x)
ivy.array([0., 0.328, 0.677, 0.842])
Array.erf(self, *, out=None)#

ivy.Array instance method variant of ivy.erf. This method simply wraps the function, and so the docstring for ivy.erf also applies to this method with minimal changes.

Parameters:
  • self (Array) – input array to compute exponential for.

  • out (Optional[Array]) – optional output, for writing the result to. It must have a shape that the (default: None) inputs broadcast to.

Return type:

Array

Returns:

ret – an array containing the Gauss error of self.

Examples

>>> x = ivy.array([0, 0.3, 0.7, 1.0])
>>> x.erf()
ivy.array([0., 0.328, 0.677, 0.842])
Container.erf(self, *, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, out=None)#

ivy.Container instance method variant of ivy.erf. This method simply wraps thefunction, and so the docstring for ivy.erf also applies to this method with minimal changes.

Parameters:
  • self (Container) – input container to compute exponential for.

  • key_chains (Optional[Union[List[str], Dict[str, str]]]) – The key-chains to apply or not apply the method to. Default is None. (default: None)

  • to_apply (bool) – If True, the method will be applied to key_chains, otherwise key_chains (default: True) will be skipped. Default is True.

  • prune_unapplied (bool) – Whether to prune key_chains for which the function was not applied. (default: False) Default is False.

  • map_sequences (bool) – Whether to also map method to sequences (lists, tuples). (default: False) Default is False.

  • out (Optional[Container]) – optional output container, for writing the result to. It must have a shape (default: None) that the inputs broadcast to.

Return type:

Container

Returns:

ret – a container containing the Gauss error of self.

Examples

>>> x = ivy.Container(a=ivy.array([-0.25, 4, 1.3]),
...                   b=ivy.array([12, -3.5, 1.234]))
>>> y = x.erf()
>>> print(y)
{
    a: ivy.array([-0.27632612, 1., 0.934008]),
    b: ivy.array([1., -0.99999928, 0.91903949])
}