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 1.411367243516627 \cdot 10^{+303}:\\
\;\;\;\;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{elif}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq \infty:\\
\;\;\;\;\frac{w0}{M \cdot \sqrt{\left(\frac{h}{\ell} \cdot {\left(\frac{D}{d}\right)}^{2}\right) \cdot -0.25}} \cdot -0.5 - M \cdot \left(w0 \cdot \sqrt{\left(\frac{h}{\ell} \cdot {\left(\frac{D}{d}\right)}^{2}\right) \cdot -0.25}\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right)\right) \cdot \frac{1}{\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 (<=
(- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))
1.411367243516627e+303)
(*
w0
(sqrt (- 1.0 (* (/ (* M D) (* 2.0 d)) (* (/ (* M D) (* 2.0 d)) (/ h l))))))
(if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) INFINITY)
(-
(* (/ w0 (* M (sqrt (* (* (/ h l) (pow (/ D d) 2.0)) -0.25)))) -0.5)
(* M (* w0 (sqrt (* (* (/ h l) (pow (/ D d) 2.0)) -0.25)))))
(*
w0
(sqrt
(-
1.0
(*
(* (/ (* M D) (* 2.0 d)) (* (/ (* M D) (* 2.0 d)) h))
(/ 1.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 ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= 1.411367243516627e+303) {
tmp = w0 * sqrt(1.0 - (((M * D) / (2.0 * d)) * (((M * D) / (2.0 * d)) * (h / l))));
} else if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= ((double) INFINITY)) {
tmp = ((w0 / (M * sqrt(((h / l) * pow((D / d), 2.0)) * -0.25))) * -0.5) - (M * (w0 * sqrt(((h / l) * pow((D / d), 2.0)) * -0.25)));
} else {
tmp = w0 * sqrt(1.0 - ((((M * D) / (2.0 * d)) * (((M * D) / (2.0 * d)) * h)) * (1.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 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < 1.411367243516627e303Initial program 0.2
rmApplied unpow2_binary64_11660.2
Applied associate-*l*_binary64_10420.2
if 1.411367243516627e303 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 63.6
Taylor expanded around -inf 56.1
Simplified46.8
if +inf.0 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 64.0
rmApplied div-inv_binary64_109864.0
Applied associate-*r*_binary64_104125.9
Simplified25.9
rmApplied unpow2_binary64_116625.9
Applied associate-*r*_binary64_104113.2
Final simplification7.7
herbie shell --seed 2021059
(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))))))