4242import dpnp .backend .extensions .ufunc ._ufunc_impl as ufi
4343from dpnp .dpnp_algo .dpnp_elementwise_common import DPNPUnaryFunc
4444
45- __all__ = ["erf" , "erfc" ]
45+ __all__ = ["erf" , "erfc" , "erfcx" ]
4646
4747
4848# pylint: disable=too-few-public-methods
@@ -96,7 +96,6 @@ def __call__(self, x, out=None): # pylint: disable=signature-differs
9696:obj:`dpnp.special.erfinv` : Inverse of the error function.
9797:obj:`dpnp.special.erfcinv` : Inverse of the complementary error function.
9898:obj:`dpnp.special.erfcx` : Scaled complementary error function.
99- :obj:`dpnp.special.erfi` : Imaginary error function.
10099
101100Notes
102101-----
@@ -152,7 +151,6 @@ def __call__(self, x, out=None): # pylint: disable=signature-differs
152151:obj:`dpnp.special.erfinv` : Inverse of the error function.
153152:obj:`dpnp.special.erfcinv` : Inverse of the complementary error function.
154153:obj:`dpnp.special.erfcx` : Scaled complementary error function.
155- :obj:`dpnp.special.erfi` : Imaginary error function.
156154
157155Examples
158156--------
@@ -171,3 +169,48 @@ def __call__(self, x, out=None): # pylint: disable=signature-differs
171169 mkl_fn_to_call = "_mkl_erf_to_call" ,
172170 mkl_impl_fn = "_erfc" ,
173171)
172+
173+ _ERFCX_DOCSTRING = r"""
174+ Calculates the scaled complementary error function of a given input array.
175+
176+ It is defined as :math:`\exp(x^2) * \operatorname{erfc}(x)`.
177+
178+ For full documentation refer to :obj:`scipy.special.erfcx`.
179+
180+ Parameters
181+ ----------
182+ x : {dpnp.ndarray, usm_ndarray}
183+ Input array, expected to have a real-valued floating-point data type.
184+ out : {dpnp.ndarray, usm_ndarray}, optional
185+ Optional output array for the function values.
186+
187+ Returns
188+ -------
189+ out : dpnp.ndarray
190+ The values of the scaled complementary error function at the given points
191+ `x`.
192+
193+ See Also
194+ --------
195+ :obj:`dpnp.special.erf` : Gauss error function.
196+ :obj:`dpnp.special.erfc` : Complementary error function.
197+ :obj:`dpnp.special.erfinv` : Inverse of the error function.
198+ :obj:`dpnp.special.erfcinv` : Inverse of the complementary error function.
199+
200+ Examples
201+ --------
202+ >>> import dpnp as np
203+ >>> x = np.linspace(-3, 3, num=4)
204+ >>> np.special.erfcx(x)
205+ array([1.62059889e+04, 5.00898008e+00, 4.27583576e-01, 1.79001151e-01])
206+
207+ """
208+
209+ erfcx = DPNPErf (
210+ "erfcx" ,
211+ ufi ._erf_result_type ,
212+ ufi ._erfcx ,
213+ _ERFCX_DOCSTRING ,
214+ mkl_fn_to_call = "_mkl_erf_to_call" ,
215+ mkl_impl_fn = "_erfcx" ,
216+ )
0 commit comments