Visible to Intel only — GUID: GUID-B73D42C8-BD32-4E69-A64A-ECBAAF10FE2A
Visible to Intel only — GUID: GUID-B73D42C8-BD32-4E69-A64A-ECBAAF10FE2A
erfinv
Computes the element-wise inverse error function of vector elements.
Description
The erfinv(a) function computes the inverse error function values for elements of the input vector a and writes them to the output vector y
y = erf-1(a),
where erf(x) is the error function defined as given by:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/5D79F116-3955-4569-92EF-1C2578A88E02-low.png)
Useful relations:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/55A475EB-77DA-4324-8301-DB3251793A8D-low.png)
where erfc is the complementary error function.
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/D78E981A-5294-46C8-B389-FDFA7F296A0C-low.png)
where
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/ED1C111D-CB67-41F2-BD95-8FC2263D14C1-low.png)
is the cumulative normal distribution function.
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/CB0452D1-F147-4A99-B5D3-A7394A52C0AC-low.png)
where and erf-1(x) are the inverses to
and erf(x), respectively.
The following figure illustrates the relationships among erfinv family functions (erfinv, erfcinv, cdfnorminv).
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/4B4F47D7-AA08-43BF-AA97-1E6D694881A6-low.png)
Useful relations for these functions:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/6A019C1D-1119-43AA-A7DA-7749D78E4F83-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-0/CD83AEB5-B6B2-418D-B5CE-3299F581EE05-low.png)
Argument |
Result |
Error Code |
---|---|---|
+0 |
+0 |
|
-0 |
-0 |
|
+1 |
+ |
status::sing |
-1 |
- |
status::sing |
|a| > 1 |
QNAN |
status::errdom |
+ |
QNAN |
status::errdom |
- |
QNAN |
status::errdom |
QNAN |
QNAN |
|
SNAN |
QNAN |
API
Syntax
Buffer API
namespace oneapi::mkl::vm { sycl::event erfinv(sycl::queue & exec_queue, std::int64_t n, sycl::buffer<T> & a, sycl::buffer<T> & y, oneapi::mkl::vm::mode mode = oneapi::mkl::vm::mode::not_defined, oneapi::mkl::vm::error_handler<T> errhandler = {}); }
namespace oneapi::mkl::vm { sycl::event erfinv(sycl::queue & exec_queue, sycl::buffer<T> & a, oneapi::mkl::slice sa, sycl::buffer<T> & y, oneapi::mkl::slice sy, oneapi::mkl::vm::mode mode = oneapi::mkl::vm::mode::not_defined, oneapi::mkl::vm::error_handler<T> errhandler = {}); }
USM API
namespace oneapi::mkl::vm { sycl::event erfinv(sycl::queue & exec_queue, std::int64_t n, T const * a, T * y, std::vector<sycl::event> const & depends = {}, oneapi::mkl::vm::mode mode = oneapi::mkl::vm::mode::not_defined, oneapi::mkl::vm::error_handler<T> errhandler = {}); }
namespace oneapi::mkl::vm { sycl::event erfinv(sycl::queue & exec_queue, T const * a, oneapi::mkl::slice sa, T * y, oneapi::mkl::slice sy, std::vector<sycl::event> const & depends = {}, oneapi::mkl::vm::mode mode = oneapi::mkl::vm::mode::not_defined, oneapi::mkl::vm::error_handler<T> errhandler = {}); }
erfinv supports the following precisions and devices:
T |
Devices supported |
---|---|
float |
CPU and GPU |
double |
CPU and GPU |
Input Parameters
Buffer API
- exec_queue
-
The queue where the routine should be executed.
- n
-
Specifies the number of elements to be calculated.
- a
-
The buffer containing the input vector.
- sa
-
Slice selector for a. See Data Types for a description of the oneMKL slice type.
- sy
-
Slice selector for y. See Data Types for a description of the oneMKL slice type.
- mode
-
Overrides the global VM mode setting for this function call. See the set_mode function for possible values and their description. This is an optional parameter. The default value is mode::not_defined.
- errhandler
-
Sets local error handling mode for this function call. See the create_error_handler function for arguments and their descriptions. This is an optional parameter. The local error handler is disabled by default.
USM API
- exec_queue
-
The queue where the routine should be executed.
- n
-
Specifies the number of elements to be calculated.
- a
-
Pointer to the input vector.
- sa
-
Slice selector for a. See Data Types for a description of the oneMKL slice type.
- sy
-
Slice selector for y. See Data Types for a description of the oneMKL slice type.
- depends
-
Vector of dependent events (to wait for input data to be ready). This is an optional parameter. The default is an empty vector.
- mode
-
Overrides the global VM mode setting for this function call. See the See the set_mode function for possible values and their description. This is an optional parameter. The default value is mode::not_defined.
- errhandler
-
Sets local error handling mode for this function call. See the create_error_handler function for arguments and their descriptions. This is an optional parameter. The local error handler is disabled by default.
Output Parameters
Buffer API
- y
-
The buffer containing the output vector.
- return value (event)
-
Computation end event.
USM API
- y
-
Pointer to the output vector.
- return value (event)
-
Computation end event.
Examples
An example of how to use erfinv can be found in the oneMKL installation directory, under:
examples/dpcpp/vml/source/verfinv.cpp