w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(h \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1.1071843267498969 \cdot 10^{-292}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{h}{\ell} \cdot \frac{M \cdot D}{2 \cdot d}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}}{\ell}}\\
\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 (<= (/ h l) (- INFINITY))
(* w0 (sqrt (- 1.0 (* (* h (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ 1.0 l)))))
(if (<= (/ h l) -1.1071843267498969e-292)
(*
w0
(sqrt
(- 1.0 (* (/ (* M D) (* 2.0 d)) (* (/ h l) (/ (* M D) (* 2.0 d)))))))
(* w0 (sqrt (- 1.0 (* h (/ (pow (/ (* M D) (* 2.0 d)) 2.0) l))))))))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 ((h / l) <= -((double) INFINITY)) {
tmp = w0 * sqrt(1.0 - ((h * pow(((M * D) / (2.0 * d)), 2.0)) * (1.0 / l)));
} else if ((h / l) <= -1.1071843267498969e-292) {
tmp = w0 * sqrt(1.0 - (((M * D) / (2.0 * d)) * ((h / l) * ((M * D) / (2.0 * d)))));
} else {
tmp = w0 * sqrt(1.0 - (h * (pow(((M * D) / (2.0 * d)), 2.0) / l)));
}
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 h l) < -inf.0Initial program 64.0
rmApplied div-inv_binary64_75764.0
Applied associate-*r*_binary64_70023.8
Simplified23.8
if -inf.0 < (/.f64 h l) < -1.1071843267498969e-292Initial program 14.6
rmApplied unpow2_binary64_82514.6
Applied associate-*l*_binary64_70113.0
if -1.1071843267498969e-292 < (/.f64 h l) Initial program 8.1
rmApplied div-inv_binary64_7578.1
Applied associate-*r*_binary64_7004.7
Simplified4.7
rmApplied associate-*l*_binary64_7014.7
Simplified4.7
Final simplification9.6
herbie shell --seed 2021007
(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))))))