fn
erfcx
→Tensorerfcx(x: Tensor)Scaled complementary error function.
Computes , the
Mills-ratio-friendly scaling of the complementary error function.
Whereas underflows to zero for moderately
large , erfcx decays only as and
remains finite, which is essential for tail-probability evaluations
of Gaussian-related distributions.
Parameters
xTensorInput tensor; any floating-point dtype.
Returns
Tensor element-wise, same shape and
dtype as x.
Notes
Mathematical definition:
The implementation forms the product of exp(x*x) and erfc(x)
directly, which is accurate for . For very
large positive x the two factors hit opposite floating-point
extremes and accuracy degrades — use a dedicated continued-fraction
expansion if extreme-value precision is required.
Examples
>>> import lucid
>>> from lucid.special import erfcx
>>> erfcx(lucid.tensor([0.0, 1.0, 5.0]))
Tensor([1.0000, 0.4276, 0.1107])