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 6.019977834666781 \cdot 10^{+90}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{{\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot h}{\ell}}\\
\mathbf{elif}\;1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell} \leq \infty:\\
\;\;\;\;\sqrt{\left(\frac{h}{\ell} \cdot {\left(\frac{D}{d}\right)}^{2}\right) \cdot -0.25} \cdot \left(w0 \cdot \left(-M\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(\frac{M \cdot D}{2 \cdot d} \cdot h\right) \cdot \frac{\frac{M}{d} \cdot \frac{D}{2}}{\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)))
6.019977834666781e+90)
(* w0 (sqrt (- 1.0 (/ (* (pow (/ (* M D) (* 2.0 d)) 2.0) h) l))))
(if (<= (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))) INFINITY)
(* (sqrt (* (* (/ h l) (pow (/ D d) 2.0)) -0.25)) (* w0 (- M)))
(*
w0
(sqrt
(- 1.0 (* (* (/ (* M D) (* 2.0 d)) h) (/ (* (/ M d) (/ D 2.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))) <= 6.019977834666781e+90) {
tmp = w0 * sqrt(1.0 - ((pow(((M * D) / (2.0 * d)), 2.0) * h) / l));
} else if ((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))) <= ((double) INFINITY)) {
tmp = sqrt(((h / l) * pow((D / d), 2.0)) * -0.25) * (w0 * -M);
} else {
tmp = w0 * sqrt(1.0 - ((((M * D) / (2.0 * d)) * h) * (((M / d) * (D / 2.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))) < 6.0199778346667809e90Initial program 0.1
rmApplied associate-*r/_binary640.2
Simplified0.2
rmApplied *-un-lft-identity_binary640.2
if 6.0199778346667809e90 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 49.6
Taylor expanded around -inf 55.1
Simplified45.2
if +inf.0 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) Initial program 64.0
rmApplied associate-*r/_binary6425.4
Simplified25.4
rmApplied sqr-pow_binary6425.4
Applied associate-*r*_binary6412.9
Simplified12.9
rmApplied *-un-lft-identity_binary6412.9
Applied times-frac_binary6410.7
Simplified10.7
Simplified10.7
rmApplied times-frac_binary6413.7
Final simplification9.1
herbie shell --seed 2021176
(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))))))