w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\begin{array}{l}
t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\
t_1 := 1 - t_0 \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_1 \leq 1.2493150413033514 \cdot 10^{+238}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{1}{\frac{\ell}{t_0 \cdot h}}}\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;w0 \cdot \left(\sqrt{\left(\frac{h}{\ell} \cdot {\left(\frac{D}{d}\right)}^{2}\right) \cdot -0.25} \cdot \left(-M\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \frac{D}{\frac{2}{\frac{M}{d}}}\\
w0 \cdot \sqrt{1 - \frac{t_2 \cdot \left(h \cdot t_2\right)}{\ell}}
\end{array}\\
\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 (pow (/ (* M D) (* 2.0 d)) 2.0)) (t_1 (- 1.0 (* t_0 (/ h l)))))
(if (<= t_1 1.2493150413033514e+238)
(* w0 (sqrt (- 1.0 (/ 1.0 (/ l (* t_0 h))))))
(if (<= t_1 INFINITY)
(* w0 (* (sqrt (* (* (/ h l) (pow (/ D d) 2.0)) -0.25)) (- M)))
(let* ((t_2 (/ D (/ 2.0 (/ M d)))))
(* w0 (sqrt (- 1.0 (/ (* t_2 (* h t_2)) 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 = pow(((M * D) / (2.0 * d)), 2.0);
double t_1 = 1.0 - (t_0 * (h / l));
double tmp;
if (t_1 <= 1.2493150413033514e+238) {
tmp = w0 * sqrt(1.0 - (1.0 / (l / (t_0 * h))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = w0 * (sqrt(((h / l) * pow((D / d), 2.0)) * -0.25) * -M);
} else {
double t_2 = D / (2.0 / (M / d));
tmp = w0 * sqrt(1.0 - ((t_2 * (h * t_2)) / 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.24931504130335139e238Initial program 0.3
rmApplied associate-*r/_binary640.8
Simplified0.8
rmApplied clear-num_binary640.8
if 1.24931504130335139e238 < (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) < +inf.0Initial program 59.0
Taylor expanded in M around -inf 55.7
Simplified48.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 associate-/l*_binary6423.2
Simplified23.2
rmApplied unpow2_binary6423.2
Applied associate-*r*_binary6412.5
Final simplification8.6
herbie shell --seed 2021212
(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))))))