erf#

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

Compute the Gauss error function of x element-wise.

Parameters:
  • x (Union[Array, NativeArray]) – input array.

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

Return type:

Array

Returns:

ret – The Gauss error function of x.

Examples

With ivy.Array inputs:

>>> x = ivy.array([0, 0.3, 0.7])
>>> y = ivy.erf(x)
>>> print(y)
ivy.array([0., 0.32862675, 0.67780113])
>>> x = ivy.array([0.1, 0.3, 0.4, 0.5])
>>> ivy.erf(x, out=x)
>>> print(x)
ivy.array([0.11246294, 0.32862675, 0.42839241, 0.52050018])
>>> x = ivy.array([[0.15, 0.28], [0.41, 1.75]])
>>> y = ivy.zeros((2, 2))
>>> ivy.erf(x, out=y)
>>> print(y)
ivy.array([[0.16799599, 0.30787992], [0.43796915, 0.98667163]])

With ivy.Container input:

>>> x = ivy.Container(a=ivy.array([0.9, 1.1, 1.2]), b=ivy.array([1.3, 1.4, 1.5]))
>>> y = ivy.erf(x)
>>> print(y)
{
    a: ivy.array([0.79690808, 0.88020504, 0.91031402]),
    b: ivy.array([0.934008, 0.95228523, 0.96610528])
}
Array.erf(self, *, out=None)[source]#

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], default: None) – optional output, for writing the result to. It must have a shape that the 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)[source]#

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], Container]], default: None) – The key-chains to apply or not apply the method to. Default is None.

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

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

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

  • out (Optional[Container], default: None) – optional output container, for writing the result to. It must have a shape 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])
}