1 - \left(\frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(0.254829592 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-0.284496736 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(1.421413741 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot \left(-1.453152027 + \frac{1}{1 + 0.3275911 \cdot \left|x\right|} \cdot 1.061405429\right)\right)\right)\right)\right) \cdot e^{-\left|x\right| \cdot \left|x\right|}\log \left(e^{1 - \frac{0.254829592 + \frac{-0.284496736 + \frac{1.421413741 + \frac{-1.453152027 + \frac{1.061405429}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{1 + 0.3275911 \cdot \left|x\right|}}{1 - {\left(\left|x\right|\right)}^{2} \cdot 0.10731592879921002} \cdot \left(1 - 0.3275911 \cdot \left|x\right|\right)}{\left(1 + 0.3275911 \cdot \left|x\right|\right) \cdot e^{{\left(\left|x\right|\right)}^{2}}}}\right)(FPCore (x)
:precision binary64
(-
1.0
(*
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
0.254829592
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
-0.284496736
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
1.421413741
(*
(/ 1.0 (+ 1.0 (* 0.3275911 (fabs x))))
(+
-1.453152027
(* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429)))))))))
(exp (- (* (fabs x) (fabs x)))))))(FPCore (x)
:precision binary64
(log
(exp
(-
1.0
(/
(+
0.254829592
(*
(/
(+
-0.284496736
(/
(+
1.421413741
(/
(+ -1.453152027 (/ 1.061405429 (+ 1.0 (* 0.3275911 (fabs x)))))
(+ 1.0 (* 0.3275911 (fabs x)))))
(+ 1.0 (* 0.3275911 (fabs x)))))
(- 1.0 (* (pow (fabs x) 2.0) 0.10731592879921002)))
(- 1.0 (* 0.3275911 (fabs x)))))
(* (+ 1.0 (* 0.3275911 (fabs x))) (exp (pow (fabs x) 2.0))))))))double code(double x) {
return 1.0 - (((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (0.254829592 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (-0.284496736 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (1.421413741 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * (-1.453152027 + ((1.0 / (1.0 + (0.3275911 * fabs(x)))) * 1.061405429))))))))) * exp(-(fabs(x) * fabs(x))));
}
double code(double x) {
return log(exp(1.0 - ((0.254829592 + (((-0.284496736 + ((1.421413741 + ((-1.453152027 + (1.061405429 / (1.0 + (0.3275911 * fabs(x))))) / (1.0 + (0.3275911 * fabs(x))))) / (1.0 + (0.3275911 * fabs(x))))) / (1.0 - (pow(fabs(x), 2.0) * 0.10731592879921002))) * (1.0 - (0.3275911 * fabs(x))))) / ((1.0 + (0.3275911 * fabs(x))) * exp(pow(fabs(x), 2.0))))));
}



Bits error versus x
Results
Initial program 14.0
rmApplied add-log-exp_binary64_280914.0
Applied add-log-exp_binary64_280914.0
Applied diff-log_binary64_286214.7
Simplified14.0
rmApplied flip-+_binary64_274714.0
Applied associate-/r/_binary64_272114.0
Simplified14.0
Final simplification14.0
herbie shell --seed 2020281
(FPCore (x)
:name "Jmat.Real.erf"
:precision binary64
(- 1.0 (* (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ 0.254829592 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ -0.284496736 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ 1.421413741 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) (+ -1.453152027 (* (/ 1.0 (+ 1.0 (* 0.3275911 (fabs x)))) 1.061405429))))))))) (exp (- (* (fabs x) (fabs x)))))))