Skip to content
fn

gelu_exact_grad_f32

void gelu_exact_grad_f32(const float *__restrict x, const float *__restrict cdf, const float *__restrict g, float *__restrict out, int n)

Second pass: out[i] = (cdf[i] + x[i] * phi(x[i])) * g[i].

Every operation is a single explicit IEEE one, so the vectorised body and the scalar tail give an element the same bits.