w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq 3.157030432195991 \cdot 10^{+20}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}}{\ell}}\\
\mathbf{elif}\;\frac{M \cdot D}{2 \cdot d} \leq 6.6428302682052605 \cdot 10^{+289}:\\
\;\;\;\;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\\
\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 (<= (/ (* M D) (* 2.0 d)) 3.157030432195991e+20)
(* w0 (sqrt (- 1.0 (/ (* h (pow (* (/ M 2.0) (/ D d)) 2.0)) l))))
(if (<= (/ (* M D) (* 2.0 d)) 6.6428302682052605e+289)
(*
w0
(sqrt
(- 1.0 (* (/ (* M D) (* 2.0 d)) (* (/ (* M D) (* 2.0 d)) (/ h 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 (((M * D) / (2.0 * d)) <= 3.157030432195991e+20) {
tmp = w0 * sqrt(1.0 - ((h * pow(((M / 2.0) * (D / d)), 2.0)) / l));
} else if (((M * D) / (2.0 * d)) <= 6.6428302682052605e+289) {
tmp = w0 * sqrt(1.0 - (((M * D) / (2.0 * d)) * (((M * D) / (2.0 * d)) * (h / 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 (*.f64 M D) (*.f64 2 d)) < 3.15703043219599e20Initial program 10.6
rmApplied associate-*r/_binary64_10536.4
Simplified6.4
rmApplied times-frac_binary64_11176.5
if 3.15703043219599e20 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 6.6428302682052605e289Initial program 29.2
rmApplied unpow2_binary64_117629.2
Applied associate-*l*_binary64_105219.9
if 6.6428302682052605e289 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 64.0
Taylor expanded around 0 55.7
Final simplification9.5
herbie shell --seed 2020288
(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))))))