Approximation of error-function erf(x)
DRY. Actual computations are repeated twice, which is always a signal for improvement:

if (x &lt; 0) {
    t = 1 / (1 - p*x);
} else {
    t = 1 / (1 + p*x);
}

result = compute_the_formula(t, x);

if (x &lt; 0) {
    result = -result;
}
return result;

Try to cut down multiplications. Instead of 

a_1*t + a_2*t*t + a_3*t*t*t


consider 

t*(a_1 + t*(a2 + t*a_3)))


Three multiplications instead of original six is not only faster, but generally more accurate.