\left(\frac{1}{\sqrt{\pi}} \cdot e^{\left|x\right| \cdot \left|x\right|}\right) \cdot \left(\left(\left(\frac{1}{\left|x\right|} + \frac{1}{2} \cdot \left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{3}{4} \cdot \left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right) + \frac{15}{8} \cdot \left(\left(\left(\left(\left(\left(\frac{1}{\left|x\right|} \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right) \cdot \frac{1}{\left|x\right|}\right)\right)\frac{1}{\sqrt{\pi}} \cdot \left({\left(e^{\left|x\right|}\right)}^{\left(\left|x\right|\right)} \cdot \left(\frac{1}{\left|x\right|} + \left(\frac{1}{2} \cdot \left({\left({\left(\sqrt{\frac{1}{\left|x\right|}}\right)}^{\left({\left(\sqrt[3]{3}\right)}^{2}\right)}\right)}^{\left(\sqrt[3]{3}\right)} \cdot {\left({\left(\sqrt{\frac{1}{\left|x\right|}}\right)}^{\left({\left(\sqrt[3]{3}\right)}^{2}\right)}\right)}^{\left(\sqrt[3]{3}\right)}\right) + \left(\frac{3}{4} \cdot {\left(\frac{1}{\left|x\right|}\right)}^{5} + \frac{15}{8} \cdot \frac{1}{{\left(\left|x\right|\right)}^{7}}\right)\right)\right)\right)(FPCore (x)
:precision binary64
(*
(* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x))))
(+
(+
(+
(/ 1.0 (fabs x))
(*
(/ 1.0 2.0)
(* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))))
(*
(/ 3.0 4.0)
(*
(*
(* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))
(/ 1.0 (fabs x)))
(/ 1.0 (fabs x)))))
(*
(/ 15.0 8.0)
(*
(*
(*
(*
(* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))
(/ 1.0 (fabs x)))
(/ 1.0 (fabs x)))
(/ 1.0 (fabs x)))
(/ 1.0 (fabs x)))))))(FPCore (x)
:precision binary64
(*
(/ 1.0 (sqrt PI))
(*
(pow (exp (fabs x)) (fabs x))
(+
(/ 1.0 (fabs x))
(+
(*
(/ 1.0 2.0)
(*
(pow (pow (sqrt (/ 1.0 (fabs x))) (pow (cbrt 3.0) 2.0)) (cbrt 3.0))
(pow (pow (sqrt (/ 1.0 (fabs x))) (pow (cbrt 3.0) 2.0)) (cbrt 3.0))))
(+
(* (/ 3.0 4.0) (pow (/ 1.0 (fabs x)) 5.0))
(* (/ 15.0 8.0) (/ 1.0 (pow (fabs x) 7.0)))))))))double code(double x) {
return ((double) (((double) ((1.0 / ((double) sqrt(((double) M_PI)))) * ((double) exp(((double) (((double) fabs(x)) * ((double) fabs(x)))))))) * ((double) (((double) (((double) ((1.0 / ((double) fabs(x))) + ((double) ((1.0 / 2.0) * ((double) (((double) ((1.0 / ((double) fabs(x))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))))))) + ((double) ((3.0 / 4.0) * ((double) (((double) (((double) (((double) ((1.0 / ((double) fabs(x))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))))))) + ((double) ((15.0 / 8.0) * ((double) (((double) (((double) (((double) (((double) (((double) ((1.0 / ((double) fabs(x))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x))))) * (1.0 / ((double) fabs(x)))))))))));
}
double code(double x) {
return ((double) ((1.0 / ((double) sqrt(((double) M_PI)))) * ((double) (((double) pow(((double) exp(((double) fabs(x)))), ((double) fabs(x)))) * ((double) ((1.0 / ((double) fabs(x))) + ((double) (((double) ((1.0 / 2.0) * ((double) (((double) pow(((double) pow(((double) sqrt((1.0 / ((double) fabs(x))))), ((double) pow(((double) cbrt(3.0)), 2.0)))), ((double) cbrt(3.0)))) * ((double) pow(((double) pow(((double) sqrt((1.0 / ((double) fabs(x))))), ((double) pow(((double) cbrt(3.0)), 2.0)))), ((double) cbrt(3.0)))))))) + ((double) (((double) ((3.0 / 4.0) * ((double) pow((1.0 / ((double) fabs(x))), 5.0)))) + ((double) ((15.0 / 8.0) * (1.0 / ((double) pow(((double) fabs(x)), 7.0)))))))))))))));
}



Bits error versus x
Results
Initial program 2.8
Simplified1.4
Taylor expanded around 0 1.2
rmApplied add-cube-cbrt1.2
Applied pow-unpow1.2
rmApplied add-sqr-sqrt1.2
Applied unpow-prod-down1.2
Applied unpow-prod-down1.2
Simplified1.2
Simplified1.2
Final simplification1.2
herbie shell --seed 2020198
(FPCore (x)
:name "Jmat.Real.erfi, branch x greater than or equal to 5"
:precision binary64
:pre (>= x 0.5)
(* (* (/ 1.0 (sqrt PI)) (exp (* (fabs x) (fabs x)))) (+ (+ (+ (/ 1.0 (fabs x)) (* (/ 1.0 2.0) (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))))) (* (/ 3.0 4.0) (* (* (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))))) (* (/ 15.0 8.0) (* (* (* (* (* (* (/ 1.0 (fabs x)) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x))) (/ 1.0 (fabs x)))))))