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}{\frac{2 \cdot d}{D}}\\
t_1 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\\
t_2 := w0 \cdot \sqrt{1 - \frac{t_0 \cdot \left(t_0 \cdot h\right)}{\ell}}\\
\mathbf{if}\;t_1 \leq 4.005006849645771 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 6.109391534461873 \cdot 10^{+302}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t_1 \cdot \frac{h}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\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 (/ (* 2.0 d) D)))
(t_1 (pow (/ (* M D) (* 2.0 d)) 2.0))
(t_2 (* w0 (sqrt (- 1.0 (/ (* t_0 (* t_0 h)) l))))))
(if (<= t_1 4.005006849645771e-69)
t_2
(if (<= t_1 6.109391534461873e+302)
(* w0 (sqrt (- 1.0 (* t_1 (/ h l)))))
t_2))))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 / ((2.0 * d) / D);
double t_1 = pow(((M * D) / (2.0 * d)), 2.0);
double t_2 = w0 * sqrt(1.0 - ((t_0 * (t_0 * h)) / l));
double tmp;
if (t_1 <= 4.005006849645771e-69) {
tmp = t_2;
} else if (t_1 <= 6.109391534461873e+302) {
tmp = w0 * sqrt(1.0 - (t_1 * (h / l)));
} else {
tmp = t_2;
}
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 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 4.00500684964577099e-69 or 6.1093915344618732e302 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) Initial program 15.6
Applied associate-*r/_binary6410.9
Applied associate-/l*_binary6410.5
Applied unpow2_binary6410.5
Applied associate-*l*_binary648.5
if 4.00500684964577099e-69 < (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) < 6.1093915344618732e302Initial program 8.3
Final simplification8.5
herbie shell --seed 2022100
(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))))))