w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\begin{array}{l}
t_0 := \frac{M \cdot D}{2 \cdot d}\\
t_1 := {t_0}^{2}\\
t_2 := w0 \cdot \sqrt{1 - t_1 \cdot \frac{h}{\ell}}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;w0 \cdot \left(D \cdot \sqrt{\left(\frac{h}{\ell} \cdot {\left(\frac{M}{d}\right)}^{2}\right) \cdot -0.25}\right)\\
\mathbf{elif}\;t_2 \leq 7.412898074004929 \cdot 10^{+305}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{t_1}{\frac{\ell}{h}}}\\
\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;-\sqrt{-0.25 \cdot \frac{h \cdot {D}^{2}}{\ell \cdot {d}^{2}}} \cdot \left(w0 \cdot M\right)\\
\mathbf{else}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{t_0}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}} \cdot \frac{t_0 \cdot h}{\sqrt[3]{\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
(let* ((t_0 (/ (* M D) (* 2.0 d)))
(t_1 (pow t_0 2.0))
(t_2 (* w0 (sqrt (- 1.0 (* t_1 (/ h l)))))))
(if (<= t_2 (- INFINITY))
(* w0 (* D (sqrt (* (* (/ h l) (pow (/ M d) 2.0)) -0.25))))
(if (<= t_2 7.412898074004929e+305)
(* w0 (sqrt (- 1.0 (/ t_1 (/ l h)))))
(if (<= t_2 INFINITY)
(-
(*
(sqrt (* -0.25 (/ (* h (pow D 2.0)) (* l (pow d 2.0)))))
(* w0 M)))
(*
w0
(sqrt
(-
1.0
(* (/ t_0 (* (cbrt l) (cbrt l))) (/ (* t_0 h) (cbrt 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 t_0 = (M * D) / (2.0 * d);
double t_1 = pow(t_0, 2.0);
double t_2 = w0 * sqrt(1.0 - (t_1 * (h / l)));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = w0 * (D * sqrt(((h / l) * pow((M / d), 2.0)) * -0.25));
} else if (t_2 <= 7.412898074004929e+305) {
tmp = w0 * sqrt(1.0 - (t_1 / (l / h)));
} else if (t_2 <= ((double) INFINITY)) {
tmp = -(sqrt(-0.25 * ((h * pow(D, 2.0)) / (l * pow(d, 2.0)))) * (w0 * M));
} else {
tmp = w0 * sqrt(1.0 - ((t_0 / (cbrt(l) * cbrt(l))) * ((t_0 * h) / cbrt(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 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < -inf.0Initial program 64.0
Applied associate-*r/_binary6459.5
Applied associate-/l*_binary6457.9
Simplified57.9
Taylor expanded in D around inf 56.7
Simplified48.4
if -inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < 7.4128980740049289e305Initial program 0.1
Applied associate-*r/_binary641.0
Applied associate-/l*_binary640.1
if 7.4128980740049289e305 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < +inf.0Initial program 62.4
Taylor expanded in M around -inf 56.8
if +inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) Initial program 64.0
Applied associate-*r/_binary6427.6
Applied unpow2_binary6427.6
Applied associate-*l*_binary6416.0
Applied add-cube-cbrt_binary6416.0
Applied times-frac_binary6414.5
Simplified14.5
Simplified14.5
Final simplification8.8
herbie shell --seed 2022066
(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))))))