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 -3.798403318024033 \cdot 10^{+76}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}}{\ell}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1.6349612123313327 \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\\
\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) -3.798403318024033e+76)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* (/ M 2.0) (/ D d)) 2.0)) l))))
(if (<= (/ h l) -1.6349612123313327e-292)
(*
w0
(sqrt
(- 1.0 (* (/ (* M D) (* 2.0 d)) (* (/ h l) (/ (* M D) (* 2.0 d)))))))
w0)))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) <= -3.798403318024033e+76) {
tmp = w0 * sqrt(1.0 - ((h * pow(((M / 2.0) * (D / d)), 2.0)) / l));
} else if ((h / l) <= -1.6349612123313327e-292) {
tmp = w0 * sqrt(1.0 - (((M * D) / (2.0 * d)) * ((h / l) * ((M * D) / (2.0 * d)))));
} else {
tmp = w0;
}
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) < -3.79840331802403327e76Initial program 29.1
rmApplied associate-*r/_binary64_105319.4
Simplified19.4
rmApplied times-frac_binary64_111719.3
if -3.79840331802403327e76 < (/.f64 h l) < -1.63496121233133271e-292Initial program 13.8
rmApplied unpow2_binary64_117613.8
Applied associate-*l*_binary64_105211.1
if -1.63496121233133271e-292 < (/.f64 h l) Initial program 7.7
Taylor expanded around 0 2.4
Final simplification8.5
herbie shell --seed 2020277
(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))))))