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

NameTypeRequiredDefaultDescription
XNumericArrayYesReal single or double input in the interval [0, 2].

Returns

NameTypeDescription
YNumericArrayElementwise inverse complementary error-function result.

Errors

IdentifierWhenMessage
RunMat:erfcinv:InvalidInputInput cannot be interpreted as a real, nonsparse numeric array.erfcinv: invalid input
RunMat:erfcinv:InternalInternal tensor construction, gathering, or upload failed.erfcinv: internal error

How erfcinv works

  • Inputs in the interval [0, 2] return real outputs.
  • erfcinv(0) returns Inf, erfcinv(1) returns 0, and erfcinv(2) returns -Inf.
  • Inputs outside [0, 2] return NaN.
  • 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) == x

Check 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 array

Use GPU inputs

G = gpuArray([0.5 1.5]);
Y = erfcinv(G)

Expected output:

Y is computed with the same numeric semantics as host inputs

Using 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.

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

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · decomposition · eig · eigs · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Symbolic

digits · int · limit · piecewise · sym · syms · vpa

Fft

fft · fft2 · fftshift · ifft · ifft2 · ifftshift

Discrete

lcm · primes

Ode

ode15s · ode23 · ode45

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how erfcinv is executed, line by line, in Rust.

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.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.