erfcinv — Compute inverse complementary error-function values.
erfcinv(X) returns the value Y such that erfc(Y) = X, evaluated element by element for real single or double inputs.
Syntax
Y = erfcinv(X)Inputs
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
X | NumericArray | Yes | — | Real single or double input in the interval [0, 2]. |
Returns
| Name | Type | Description |
|---|---|---|
Y | NumericArray | Elementwise inverse complementary error-function result. |
Errors
| Identifier | When | Message |
|---|---|---|
RunMat:erfcinv:InvalidInput | Input cannot be interpreted as a real, nonsparse numeric array. | erfcinv: invalid input |
RunMat:erfcinv:Internal | Internal tensor construction, gathering, or upload failed. | erfcinv: internal error |
How erfcinv works
- Inputs in the interval
[0, 2]return real outputs. erfcinv(0)returnsInf,erfcinv(1)returns0, anderfcinv(2)returns-Inf.- Inputs outside
[0, 2]returnNaN. - NaN values propagate to NaN outputs.
- Logical, integer-class, char, complex, string, and sparse inputs are rejected.
Does RunMat run erfcinv on the GPU?
WGPU and the simple provider implement unary_erfcinv for real dense buffers.
The provider path preserves shape, NaN, endpoint, and single/double dtype behavior.
GPU memory and residency
G = gpuArray([0.5 1.5]);
Y = erfcinv(G)Expected behavior: Y contains the inverse complementary error-function values and remains GPU-resident through the active provider.
Examples
Invert complementary error-function values
x = [0.25 0.5 1 1.5 1.75];
y = erfcinv(x)Expected output:
y contains real values satisfying erfc(y) == xCheck endpoint behavior
erfcinv([0 1 2])Expected output:
[Inf 0 -Inf]Preserve array shape
X = reshape([0.5 1 1.5 2], [2 2]);
Y = erfcinv(X)Expected output:
Y is a 2-by-2 numeric arrayUse GPU inputs
G = gpuArray([0.5 1.5]);
Y = erfcinv(G)Expected output:
Y is computed with the same numeric semantics as host inputsUsing erfcinv with coding agents
Open a RunMat example with live inputs, then ask the agent to explain how erfcinv changes the result.
Run a small erfcinv example, explain the result, then change one input and compare the output.
FAQ
How is erfcinv related to erf?⌄
erfcinv(x) is the inverse of erfc(y) = 1 - erf(y), so erfc(erfcinv(x)) returns x for values in the supported real domain.
What happens outside the real domain?⌄
RunMat returns NaN for real values less than 0 or greater than 2, matching MATLAB's real-valued inverse complementary error-function behavior.
Does erfcinv run on the GPU?⌄
Yes. Providers can evaluate real gpuArray inputs with a unary erfcinv kernel and keep the result resident; unsupported providers fall back to CPU evaluation and re-upload when possible.
Related Math functions
Elementwise
abs · angle · bsxfun · complex · conj · double · erf · exp · expm1 · factorial · flintmax · gamma · gammaln · heaviside · hypot · idivide · imag · intmax · intmin · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · realmax · realmin · realsqrt · rescale · sign · single · sqrt · swapbytes · times · uint32
Trigonometry
acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · cospi · deg2rad · pol2cart · rad2deg · sin · sind · sinh · sinpi · tan · tand · tanh
Reduction
all · any · bounds · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · maxk · mean · median · min · mink · movmax · movmean · movmedian · movmin · movprod · movstd · movsum · movvar · nnz · prod · rms · std · sum · trapz · var
Structure
bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm
Signal
blackman · butter · buttord · cheb2ord · conv · conv2 · deconv · downsample · envelope · filter · filtfilt · fir1 · freqz · gauspuls · hamming · hann · hilbert · periodogram · pulstran · pwelch · rectpuls · resample · sawtooth · sinc · spectrogram · square · tripuls · unwrap · upsample · zplane
Optim
coneprog · fminbnd · fminunc · fsolve · fzero · integral · linprog · lsqcurvefit · lsqnonlin · optimset · quad · secondordercone
Ops
cross · ctranspose · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · pagetranspose · trace · transpose
Open-source implementation
Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how erfcinv is executed, line by line, in Rust.
- View the source for erfcinv in Rust on GitHub
- Learn how the RunMat runtime works
- Found a bug? Open an issue with a minimal reproduction.
About RunMat
RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.
- RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
- Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.