\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 -7851132100663122940:\\
\;\;\;\;\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{1}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\sqrt[3]{\ell}}\right)}^{\left(\frac{1}{2}\right)}\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)\\
\mathbf{elif}\;\ell \le 5.8147762968261544 \cdot 10^{-33}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\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)\\
\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 <= -7.851132100663123e+18)) {
VAR = (((pow(((cbrt(d) * cbrt(d)) / (cbrt(h) * cbrt(h))), (1.0 / 2.0)) * pow((cbrt(d) / cbrt(h)), (1.0 / 2.0))) * (pow((1.0 / (cbrt(l) * cbrt(l))), (1.0 / 2.0)) * pow((d / cbrt(l)), (1.0 / 2.0)))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l))));
} else {
double VAR_1;
if ((l <= 5.8147762968261544e-33)) {
VAR_1 = ((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))))));
} else {
VAR_1 = ((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)))));
}
VAR = VAR_1;
}
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 < -7.851132100663123e+18Initial program 26.5
rmApplied add-cube-cbrt26.7
Applied add-cube-cbrt26.8
Applied times-frac26.8
Applied unpow-prod-down20.4
rmApplied add-cube-cbrt20.4
Applied *-un-lft-identity20.4
Applied times-frac20.4
Applied unpow-prod-down17.1
if -7.851132100663123e+18 < l < 5.8147762968261544e-33Initial program 27.4
rmApplied add-cube-cbrt27.7
Applied add-cube-cbrt27.8
Applied times-frac27.8
Applied unpow-prod-down24.7
rmApplied add-cube-cbrt24.8
Applied add-cube-cbrt25.0
Applied times-frac25.0
Applied unpow-prod-down20.1
rmApplied associate-*l/20.1
Applied frac-times10.5
rmApplied add-cube-cbrt10.7
if 5.8147762968261544e-33 < l Initial program 26.3
rmApplied add-cube-cbrt26.6
Applied add-cube-cbrt26.7
Applied times-frac26.7
Applied unpow-prod-down20.3
rmApplied add-cube-cbrt20.3
Applied add-cube-cbrt20.5
Applied times-frac20.5
Applied unpow-prod-down17.4
rmApplied associate-*l*16.8
Final simplification14.8
herbie shell --seed 2020079 +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)))))