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 -2.40632328432371 \cdot 10^{+295}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \left(h \cdot \frac{M \cdot D}{2 \cdot d}\right)\right) \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -2.3342666799398 \cdot 10^{-313}:\\
\;\;\;\;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) -2.40632328432371e+295)
(*
w0
(sqrt
(-
1.0
(* (* (/ (* M D) (* 2.0 d)) (* h (/ (* M D) (* 2.0 d)))) (/ 1.0 l)))))
(if (<= (/ h l) -2.3342666799398e-313)
(*
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) <= -2.40632328432371e+295) {
tmp = w0 * sqrt(1.0 - ((((M * D) / (2.0 * d)) * (h * ((M * D) / (2.0 * d)))) * (1.0 / l)));
} else if ((h / l) <= -2.3342666799398e-313) {
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) < -2.40632328432371e295Initial program 60.5
rmApplied div-inv_binary64_110860.5
Applied associate-*r*_binary64_105127.0
Simplified27.0
rmApplied unpow2_binary64_117627.0
Applied associate-*r*_binary64_105123.2
Simplified23.2
if -2.40632328432371e295 < (/.f64 h l) < -2.33426668e-313Initial program 13.3
rmApplied unpow2_binary64_117613.3
Applied associate-*l*_binary64_105211.2
if -2.33426668e-313 < (/.f64 h l) Initial program 7.3
Taylor expanded around 0 2.4
Final simplification7.8
herbie shell --seed 2020280
(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))))))