w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\begin{array}{l}
\mathbf{if}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq 9.289331754471127 \cdot 10^{+296}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{1}{\frac{2 \cdot d}{M \cdot D}}\right)}^{2}}\\
\mathbf{elif}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq \infty:\\
\;\;\;\;w0 \cdot \left(-\frac{D \cdot \left(M \cdot \sqrt{0.5}\right)}{d} \cdot \sqrt{\frac{h \cdot {\left(\sqrt[3]{-0.5}\right)}^{3}}{\ell}}\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 (<=
(- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))
9.289331754471127e+296)
(* w0 (sqrt (- 1.0 (* (/ h l) (pow (/ 1.0 (/ (* 2.0 d) (* M D))) 2.0)))))
(if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) INFINITY)
(*
w0
(-
(*
(/ (* D (* M (sqrt 0.5))) d)
(sqrt (/ (* h (pow (cbrt -0.5) 3.0)) l)))))
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 ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 9.289331754471127e+296) {
tmp = w0 * sqrt(1.0 - ((h / l) * pow((1.0 / ((2.0 * d) / (M * D))), 2.0)));
} else if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= ((double) INFINITY)) {
tmp = w0 * -(((D * (M * sqrt(0.5))) / d) * sqrt((h * pow(cbrt(-0.5), 3.0)) / l));
} 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 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 9.2893317544711272e296Initial program 0.2
rmApplied clear-num_binary640.2
if 9.2893317544711272e296 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 63.5
rmApplied div-inv_binary6463.5
Applied associate-*r*_binary6458.9
Simplified58.9
rmApplied add-cube-cbrt_binary6458.9
Applied unpow-prod-down_binary6458.9
Applied associate-*r*_binary6455.5
Simplified55.4
Taylor expanded around -inf 51.2
if +inf.0 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 64.0
Taylor expanded around 0 14.6
Final simplification8.5
herbie shell --seed 2021147
(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))))))