\frac{\left(\left(\left(\left(1 + 0.1049934947 \cdot \left(x \cdot x\right)\right) + 0.0424060604 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) + 0.0072644182 \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right) + 0.0005064034 \cdot \left(\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right) + 0.0001789971 \cdot \left(\left(\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)}{\left(\left(\left(\left(\left(1 + 0.7715471019 \cdot \left(x \cdot x\right)\right) + 0.2909738639 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\right) + 0.0694555761 \cdot \left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right) + 0.0140005442 \cdot \left(\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right) + 0.0008327945 \cdot \left(\left(\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)\right) + \left(2 \cdot 0.0001789971\right) \cdot \left(\left(\left(\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right) \cdot \left(x \cdot x\right)\right)} \cdot x\begin{array}{l}
\mathbf{if}\;x \leq -1.4787843671655092:\\
\;\;\;\;\frac{0.5}{x} + \left(\left(\frac{0.2514179000665374}{{x}^{3}} + \frac{0.15298196345929152}{{x}^{5}}\right) + \frac{11.259630434457213}{{x}^{7}}\right)\\
\mathbf{elif}\;x \leq 1.1356453934542152:\\
\;\;\;\;x \cdot \left(\left(0.26570970039615094 \cdot {x}^{4} + 1\right) - 0.6665536072 \cdot {x}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{x} + \left(\frac{0.2514179000665374}{{x}^{3}} + \frac{0.15298196345929152}{{x}^{5}}\right)\\
\end{array}(FPCore (x)
:precision binary64
(*
(/
(+
(+
(+
(+ (+ 1.0 (* 0.1049934947 (* x x))) (* 0.0424060604 (* (* x x) (* x x))))
(* 0.0072644182 (* (* (* x x) (* x x)) (* x x))))
(* 0.0005064034 (* (* (* (* x x) (* x x)) (* x x)) (* x x))))
(* 0.0001789971 (* (* (* (* (* x x) (* x x)) (* x x)) (* x x)) (* x x))))
(+
(+
(+
(+
(+
(+ 1.0 (* 0.7715471019 (* x x)))
(* 0.2909738639 (* (* x x) (* x x))))
(* 0.0694555761 (* (* (* x x) (* x x)) (* x x))))
(* 0.0140005442 (* (* (* (* x x) (* x x)) (* x x)) (* x x))))
(* 0.0008327945 (* (* (* (* (* x x) (* x x)) (* x x)) (* x x)) (* x x))))
(*
(* 2.0 0.0001789971)
(* (* (* (* (* (* x x) (* x x)) (* x x)) (* x x)) (* x x)) (* x x)))))
x))(FPCore (x)
:precision binary64
(if (<= x -1.4787843671655092)
(+
(/ 0.5 x)
(+
(+ (/ 0.2514179000665374 (pow x 3.0)) (/ 0.15298196345929152 (pow x 5.0)))
(/ 11.259630434457213 (pow x 7.0))))
(if (<= x 1.1356453934542152)
(*
x
(-
(+ (* 0.26570970039615094 (pow x 4.0)) 1.0)
(* 0.6665536072 (pow x 2.0))))
(+
(/ 0.5 x)
(+
(/ 0.2514179000665374 (pow x 3.0))
(/ 0.15298196345929152 (pow x 5.0)))))))double code(double x) {
return ((((((1.0 + (0.1049934947 * (x * x))) + (0.0424060604 * ((x * x) * (x * x)))) + (0.0072644182 * (((x * x) * (x * x)) * (x * x)))) + (0.0005064034 * ((((x * x) * (x * x)) * (x * x)) * (x * x)))) + (0.0001789971 * (((((x * x) * (x * x)) * (x * x)) * (x * x)) * (x * x)))) / ((((((1.0 + (0.7715471019 * (x * x))) + (0.2909738639 * ((x * x) * (x * x)))) + (0.0694555761 * (((x * x) * (x * x)) * (x * x)))) + (0.0140005442 * ((((x * x) * (x * x)) * (x * x)) * (x * x)))) + (0.0008327945 * (((((x * x) * (x * x)) * (x * x)) * (x * x)) * (x * x)))) + ((2.0 * 0.0001789971) * ((((((x * x) * (x * x)) * (x * x)) * (x * x)) * (x * x)) * (x * x))))) * x;
}
double code(double x) {
double tmp;
if (x <= -1.4787843671655092) {
tmp = (0.5 / x) + (((0.2514179000665374 / pow(x, 3.0)) + (0.15298196345929152 / pow(x, 5.0))) + (11.259630434457213 / pow(x, 7.0)));
} else if (x <= 1.1356453934542152) {
tmp = x * (((0.26570970039615094 * pow(x, 4.0)) + 1.0) - (0.6665536072 * pow(x, 2.0)));
} else {
tmp = (0.5 / x) + ((0.2514179000665374 / pow(x, 3.0)) + (0.15298196345929152 / pow(x, 5.0)));
}
return tmp;
}



Bits error versus x
Results
if x < -1.4787843671655092Initial program 58.6
Simplified58.6
Taylor expanded around inf 0.2
Simplified0.2
if -1.4787843671655092 < x < 1.1356453934542152Initial program 0.0
Simplified0.0
Taylor expanded around 0 0.2
if 1.1356453934542152 < x Initial program 58.4
Simplified58.4
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2021016
(FPCore (x)
:name "Jmat.Real.dawson"
:precision binary64
(* (/ (+ (+ (+ (+ (+ 1.0 (* 0.1049934947 (* x x))) (* 0.0424060604 (* (* x x) (* x x)))) (* 0.0072644182 (* (* (* x x) (* x x)) (* x x)))) (* 0.0005064034 (* (* (* (* x x) (* x x)) (* x x)) (* x x)))) (* 0.0001789971 (* (* (* (* (* x x) (* x x)) (* x x)) (* x x)) (* x x)))) (+ (+ (+ (+ (+ (+ 1.0 (* 0.7715471019 (* x x))) (* 0.2909738639 (* (* x x) (* x x)))) (* 0.0694555761 (* (* (* x x) (* x x)) (* x x)))) (* 0.0140005442 (* (* (* (* x x) (* x x)) (* x x)) (* x x)))) (* 0.0008327945 (* (* (* (* (* x x) (* x x)) (* x x)) (* x x)) (* x x)))) (* (* 2.0 0.0001789971) (* (* (* (* (* (* x x) (* x x)) (* x x)) (* x x)) (* x x)) (* x x))))) x))