\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 \le -1.7787897735965389 \cdot 10^{-79} \lor \neg \left(\ell \le 3.2434710140173009 \cdot 10^{-84}\right):\\
\;\;\;\;\left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{h} \cdot \sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(\left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{\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)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\left(\left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{h} \cdot \sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)}\right)\right) \cdot \left(1 - \frac{\left(1 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{2 \cdot \ell}\right)} \cdot \sqrt[3]{\left(\left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{h} \cdot \sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)}\right)\right) \cdot \left(1 - \frac{\left(1 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{2 \cdot \ell}\right)}\right) \cdot \sqrt[3]{\left(\left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{h} \cdot \sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{h}}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left({\left(\frac{\sqrt[3]{d} \cdot \sqrt[3]{d}}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{\sqrt[3]{d}}{\sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)}\right)\right) \cdot \left(1 - \frac{\left(1 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot h}{2 \cdot \ell}\right)}\\
\end{array}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 VAR;
if (((l <= -1.778789773596539e-79) || !(l <= 3.243471014017301e-84))) {
VAR = ((pow(((cbrt(d) * cbrt(d)) / (cbrt(h) * cbrt(h))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(h)), (1.0 / 2.0))) * ((pow(((cbrt(d) * cbrt(d)) / (cbrt(l) * cbrt(l))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(l)), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))));
} else {
VAR = ((cbrt((((pow(((cbrt(d) * cbrt(d)) / (cbrt(h) * cbrt(h))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(h)), (1.0 / 2.0))) * (pow(((cbrt(d) * cbrt(d)) / (cbrt(l) * cbrt(l))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(l)), (1.0 / 2.0)))) * (1.0 - (((1.0 * pow(((M * D) / (2.0 * d)), 2.0)) * h) / (2.0 * l))))) * cbrt((((pow(((cbrt(d) * cbrt(d)) / (cbrt(h) * cbrt(h))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(h)), (1.0 / 2.0))) * (pow(((cbrt(d) * cbrt(d)) / (cbrt(l) * cbrt(l))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(l)), (1.0 / 2.0)))) * (1.0 - (((1.0 * pow(((M * D) / (2.0 * d)), 2.0)) * h) / (2.0 * l)))))) * cbrt((((pow(((cbrt(d) * cbrt(d)) / (cbrt(h) * cbrt(h))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(h)), (1.0 / 2.0))) * (pow(((cbrt(d) * cbrt(d)) / (cbrt(l) * cbrt(l))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(l)), (1.0 / 2.0)))) * (1.0 - (((1.0 * pow(((M * D) / (2.0 * d)), 2.0)) * h) / (2.0 * l))))));
}
return VAR;
}



Bits error versus d



Bits error versus h



Bits error versus l



Bits error versus M



Bits error versus D
Results
if l < -1.778789773596539e-79 or 3.243471014017301e-84 < l Initial program 25.3
rmApplied add-cube-cbrt25.6
Applied add-cube-cbrt25.7
Applied times-frac25.7
Applied unpow-prod-down19.6
rmApplied add-cube-cbrt19.7
Applied add-cube-cbrt19.9
Applied times-frac19.9
Applied unpow-prod-down16.2
rmApplied associate-*l*15.4
if -1.778789773596539e-79 < l < 3.243471014017301e-84Initial program 30.0
rmApplied add-cube-cbrt30.3
Applied add-cube-cbrt30.4
Applied times-frac30.4
Applied unpow-prod-down28.5
rmApplied add-cube-cbrt28.6
Applied add-cube-cbrt28.8
Applied times-frac28.8
Applied unpow-prod-down23.2
rmApplied associate-*l/23.2
Applied frac-times10.4
rmApplied add-cube-cbrt10.6
Final simplification14.3
herbie shell --seed 2020102 +o rules:numerics
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1 2)) (pow (/ d l) (/ 1 2))) (- 1 (* (* (/ 1 2) (pow (/ (* M D) (* 2 d)) 2)) (/ h l)))))