\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}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 2.6293176454421138 \cdot 10^{-173}:\\
\;\;\;\;\left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\sqrt{\frac{1}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}} \cdot \sqrt{\frac{d}{\sqrt[3]{\ell}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{\ell}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{\ell}}}\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}\right)}{\ell}\right)\\
\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 (<=
(*
(* (pow (/ d h) 0.5) (pow (/ d l) 0.5))
(- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l))))
2.6293176454421138e-173)
(*
(- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l)))
(*
(* (fabs (/ (cbrt d) (cbrt h))) (sqrt (/ (cbrt d) (cbrt h))))
(* (sqrt (/ 1.0 (* (cbrt l) (cbrt l)))) (sqrt (/ d (cbrt l))))))
(*
(*
(* (fabs (/ (cbrt d) (cbrt h))) (sqrt (/ (cbrt d) (cbrt h))))
(* (fabs (/ (cbrt d) (cbrt l))) (sqrt (/ (cbrt d) (cbrt l)))))
(- 1.0 (/ (* h (* 0.5 (pow (* (/ M 2.0) (/ D d)) 2.0))) l)))))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 (((pow((d / h), 0.5) * pow((d / l), 0.5)) * (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)))) <= 2.6293176454421138e-173) {
tmp = (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l))) * ((fabs(cbrt(d) / cbrt(h)) * sqrt(cbrt(d) / cbrt(h))) * (sqrt(1.0 / (cbrt(l) * cbrt(l))) * sqrt(d / cbrt(l))));
} else {
tmp = ((fabs(cbrt(d) / cbrt(h)) * sqrt(cbrt(d) / cbrt(h))) * (fabs(cbrt(d) / cbrt(l)) * sqrt(cbrt(d) / cbrt(l)))) * (1.0 - ((h * (0.5 * pow(((M / 2.0) * (D / d)), 2.0))) / l));
}
return tmp;
}



Bits error versus d



Bits error versus h



Bits error versus l



Bits error versus M



Bits error versus D
Results
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < 2.6293176454421138e-173Initial program 28.3
Simplified28.3
rmApplied add-cube-cbrt_binary64_147728.4
Applied add-cube-cbrt_binary64_147728.5
Applied times-frac_binary64_144828.5
Applied sqrt-prod_binary64_145826.0
Simplified26.0
rmApplied add-cube-cbrt_binary64_147726.1
Applied *-un-lft-identity_binary64_144226.1
Applied times-frac_binary64_144826.1
Applied sqrt-prod_binary64_145819.3
if 2.6293176454421138e-173 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 25.7
Simplified25.7
rmApplied add-cube-cbrt_binary64_147726.0
Applied add-cube-cbrt_binary64_147726.1
Applied times-frac_binary64_144826.1
Applied sqrt-prod_binary64_145819.5
Simplified18.6
rmApplied associate-*r/_binary64_138416.3
Simplified16.3
rmApplied add-cube-cbrt_binary64_147716.4
Applied add-cube-cbrt_binary64_147716.6
Applied times-frac_binary64_144816.6
Applied sqrt-prod_binary64_145812.5
Simplified11.8
rmApplied times-frac_binary64_144811.7
Final simplification14.0
herbie shell --seed 2021064
(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)))))