\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}\;h \leq 1.8341402207961 \cdot 10^{-310}:\\
\;\;\;\;\left(\left(\left|\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right| \cdot \sqrt{\frac{\sqrt[3]{d}}{\sqrt[3]{h}}}\right) \cdot \left(\sqrt[3]{\sqrt{\frac{d}{\ell}}} \cdot \left(\sqrt[3]{\sqrt{\frac{d}{\ell}}} \cdot \sqrt[3]{\sqrt{\frac{d}{\ell}}}\right)\right)\right) \cdot \left(1 - \frac{h \cdot \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)}{\ell}\right)\\
\mathbf{elif}\;h \leq 3.9383585648083115 \cdot 10^{+207}:\\
\;\;\;\;\frac{d \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)}{\sqrt{h} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\
\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 (<= h 1.8341402207961e-310)
(*
(*
(* (fabs (/ (cbrt d) (cbrt h))) (sqrt (/ (cbrt d) (cbrt h))))
(* (cbrt (sqrt (/ d l))) (* (cbrt (sqrt (/ d l))) (cbrt (sqrt (/ d l))))))
(- 1.0 (/ (* h (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0))) l)))
(if (<= h 3.9383585648083115e+207)
(/
(* d (- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l))))
(* (sqrt h) (sqrt l)))
(* d (sqrt (/ 1.0 (* h 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 (h <= 1.8341402207961e-310) {
tmp = ((fabs(cbrt(d) / cbrt(h)) * sqrt(cbrt(d) / cbrt(h))) * (cbrt(sqrt(d / l)) * (cbrt(sqrt(d / l)) * cbrt(sqrt(d / l))))) * (1.0 - ((h * (0.5 * pow(((M * D) / (d * 2.0)), 2.0))) / l));
} else if (h <= 3.9383585648083115e+207) {
tmp = (d * (1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l)))) / (sqrt(h) * sqrt(l));
} else {
tmp = d * sqrt(1.0 / (h * 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 h < 1.834140220796106e-310Initial program 26.5
Simplified26.5
rmApplied add-cube-cbrt_binary64_113626.8
Applied add-cube-cbrt_binary64_113626.9
Applied times-frac_binary64_110726.9
Applied sqrt-prod_binary64_111721.6
Simplified20.9
rmApplied add-cube-cbrt_binary64_113621.2
rmApplied associate-*r/_binary64_104319.7
if 1.834140220796106e-310 < h < 3.93835856480831151e207Initial program 25.7
Simplified25.7
rmApplied sqrt-div_binary64_111820.5
Applied sqrt-div_binary64_111813.8
Applied frac-times_binary64_111113.8
Applied associate-*l/_binary64_104413.5
Simplified13.4
if 3.93835856480831151e207 < h Initial program 35.4
Simplified35.4
Taylor expanded around 0 42.0
Simplified42.0
Final simplification18.9
herbie shell --seed 2020344
(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)))))