w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\begin{array}{l}
\mathbf{if}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -\infty:\\
\;\;\;\;\sqrt{\left(\frac{h}{\ell} \cdot {\left(\frac{D}{d}\right)}^{2}\right) \cdot -0.25} \cdot \left(\left(-M\right) \cdot w0\right)\\
\mathbf{elif}\;{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq -1.3592672201317897 \cdot 10^{+133}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{h}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt[3]{{\left(\sqrt{1 - \frac{h \cdot {\left(\frac{M}{d} \cdot \frac{D}{2}\right)}^{2}}{\ell}}\right)}^{3}}\\
\end{array}(FPCore (w0 M D h l d) :precision binary64 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
(FPCore (w0 M D h l d)
:precision binary64
(if (<= (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)) (- INFINITY))
(* (sqrt (* (* (/ h l) (pow (/ D d) 2.0)) -0.25)) (* (- M) w0))
(if (<=
(* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))
-1.3592672201317897e+133)
(*
w0
(sqrt
(- 1.0 (* (/ (* M D) (* 2.0 d)) (* (/ (* M D) (* 2.0 d)) (/ h l))))))
(*
w0
(cbrt
(pow
(sqrt (- 1.0 (/ (* h (pow (* (/ M d) (/ D 2.0)) 2.0)) l)))
3.0))))))double code(double w0, double M, double D, double h, double l, double d) {
return w0 * sqrt(1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l)));
}
double code(double w0, double M, double D, double h, double l, double d) {
double tmp;
if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -((double) INFINITY)) {
tmp = sqrt(((h / l) * pow((D / d), 2.0)) * -0.25) * (-M * w0);
} else if ((pow(((M * D) / (2.0 * d)), 2.0) * (h / l)) <= -1.3592672201317897e+133) {
tmp = w0 * sqrt(1.0 - (((M * D) / (2.0 * d)) * (((M * D) / (2.0 * d)) * (h / l))));
} else {
tmp = w0 * cbrt(pow(sqrt(1.0 - ((h * pow(((M / d) * (D / 2.0)), 2.0)) / l)), 3.0));
}
return tmp;
}



Bits error versus w0



Bits error versus M



Bits error versus D



Bits error versus h



Bits error versus l



Bits error versus d
Results
if (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0Initial program 64.0
Taylor expanded around -inf 57.2
Simplified47.9
if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -1.35926722013178966e133Initial program 0.5
rmApplied unpow2_binary64_8250.5
Applied associate-*l*_binary64_7010.5
if -1.35926722013178966e133 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 6.8
rmApplied div-inv_binary64_7576.8
Applied associate-*r*_binary64_7003.4
Simplified3.4
rmApplied add-cbrt-cube_binary64_7963.4
Simplified3.4
rmApplied times-frac_binary64_7663.5
Final simplification9.4
herbie shell --seed 2021028
(FPCore (w0 M D h l d)
:name "Henrywood and Agarwal, Equation (9a)"
:precision binary64
(* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))