\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)
\begin{array}{l}
t_0 := {\left(e^{x}\right)}^{\left(\frac{x}{2}\right)}\\
t_1 := \sqrt{\frac{1}{\pi}}\\
t_0 \cdot \left(t_0 \cdot \left(t_1 \cdot \left(1.875 \cdot \frac{1}{{x}^{7}} + 0.75 \cdot \frac{1}{{x}^{5}}\right) + t_1 \cdot \left(\frac{1}{x} + 0.5 \cdot \frac{1}{{x}^{3}}\right)\right)\right)
\end{array}
(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
(let* ((t_0 (pow (exp x) (/ x 2.0))) (t_1 (sqrt (/ 1.0 PI))))
(*
t_0
(*
t_0
(+
(* t_1 (+ (* 1.875 (/ 1.0 (pow x 7.0))) (* 0.75 (/ 1.0 (pow x 5.0)))))
(* t_1 (+ (/ 1.0 x) (* 0.5 (/ 1.0 (pow x 3.0))))))))))double code(double x) {
return ((1.0 / sqrt((double) M_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)))));
}
double code(double x) {
double t_0 = pow(exp(x), (x / 2.0));
double t_1 = sqrt(1.0 / ((double) M_PI));
return t_0 * (t_0 * ((t_1 * ((1.875 * (1.0 / pow(x, 7.0))) + (0.75 * (1.0 / pow(x, 5.0))))) + (t_1 * ((1.0 / x) + (0.5 * (1.0 / pow(x, 3.0)))))));
}



Bits error versus x
Results
Initial program 2.8
Simplified2.7
Applied add-log-exp_binary642.7
Applied exp-to-pow_binary641.3
Applied *-un-lft-identity_binary641.3
Applied div-inv_binary641.2
Applied times-frac_binary641.2
Applied associate-*l*_binary641.2
Taylor expanded in x around 0 1.2
Simplified1.2
Applied *-un-lft-identity_binary641.2
Applied sqr-pow_binary641.3
Applied times-frac_binary641.3
Applied associate-*l*_binary641.2
Final simplification1.2
herbie shell --seed 2022125
(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)))))))