\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.886411138624743 \cdot 10^{-61} \lor \neg \left(\ell \leq 4.4903038537844864 \cdot 10^{+116}\right):\\
\;\;\;\;\begin{array}{l}
t_0 := \frac{\sqrt[3]{d}}{\sqrt[3]{h}}\\
t_1 := \frac{\sqrt[3]{d}}{\sqrt[3]{\ell}}\\
\left(\left(\left|t_0\right| \cdot \sqrt{t_0}\right) \cdot \left(\left|t_1\right| \cdot \sqrt{t_1}\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{M}{\frac{d}{\frac{D}{2}}}\right)}^{2}\right)}{\ell}\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;-0.125 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{d} \cdot \sqrt{\frac{h}{{\ell}^{3}}}\right) + d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\
\end{array}
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(FPCore (d h l M D)
:precision binary64
(if (or (<= l 3.886411138624743e-61) (not (<= l 4.4903038537844864e+116)))
(let* ((t_0 (/ (cbrt d) (cbrt h))) (t_1 (/ (cbrt d) (cbrt l))))
(*
(* (* (fabs t_0) (sqrt t_0)) (* (fabs t_1) (sqrt t_1)))
(- 1.0 (/ (* h (* 0.5 (pow (/ M (/ d (/ D 2.0))) 2.0))) l))))
(+
(* -0.125 (* (/ (* (* M D) (* M D)) d) (sqrt (/ h (pow l 3.0)))))
(* d (sqrt (/ 1.0 (* l h)))))))double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((l <= 3.886411138624743e-61) || !(l <= 4.4903038537844864e+116)) {
double t_0_1 = cbrt(d) / cbrt(h);
double t_1_2 = cbrt(d) / cbrt(l);
tmp = ((fabs(t_0_1) * sqrt(t_0_1)) * (fabs(t_1_2) * sqrt(t_1_2))) * (1.0 - ((h * (0.5 * pow((M / (d / (D / 2.0))), 2.0))) / l));
} else {
tmp = (-0.125 * ((((M * D) * (M * D)) / d) * sqrt(h / pow(l, 3.0)))) + (d * sqrt(1.0 / (l * h)));
}
return tmp;
}



Bits error versus d



Bits error versus h



Bits error versus l



Bits error versus M



Bits error versus D
Results
if l < 3.88641113862474331e-61 or 4.49030385378448638e116 < l Initial program 27.6
Simplified27.6
rmApplied add-cube-cbrt_binary6427.8
Applied add-cube-cbrt_binary6427.9
Applied times-frac_binary6427.9
Applied sqrt-prod_binary6422.9
Simplified22.1
rmApplied associate-*r/_binary6420.5
Simplified20.5
rmApplied add-cube-cbrt_binary6420.6
Applied add-cube-cbrt_binary6420.7
Applied times-frac_binary6420.7
Applied sqrt-prod_binary6415.1
Simplified14.4
rmApplied associate-/l*_binary6414.5
Simplified14.5
if 3.88641113862474331e-61 < l < 4.49030385378448638e116Initial program 21.8
Simplified21.8
Taylor expanded in d around 0 27.6
Simplified14.3
Final simplification14.5
herbie shell --seed 2021197
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))