Skip to content
fn

verf_f32

void verf_f32(const float * in, float * out, int n)

Single-precision Gauss error function.

Computes outi=erf(ini)\text{out}_i = \mathrm{erf}(\text{in}_i) via vverff, where erf(x)=2π∫0xe−t2 dt\mathrm{erf}(x) = \tfrac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} \, dt. Used by GELU activation among others.

References

Accelerate.framework vverff.

Parameters

inconst float*
Input buffer.
outfloat*
Output buffer.
nstd::size_t
Element count.