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}\\
\mathbf{if}\;{t_0}^{2} \cdot \frac{h}{\ell} \leq -\infty:\\
\;\;\;\;w0 \cdot \left(D \cdot \sqrt{\frac{h \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)} \cdot -0.25}\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt[3]{t_0}\\
w0 \cdot \sqrt{1 - \frac{\left(h \cdot \left(t_0 \cdot t_1\right)\right) \cdot {t_1}^{2}}{\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 (/ (* M D) (* 2.0 d))))
(if (<= (* (pow t_0 2.0) (/ h l)) (- INFINITY))
(* w0 (* D (sqrt (* (/ (* h (* M M)) (* l (* d d))) -0.25))))
(let* ((t_1 (cbrt t_0)))
(* w0 (sqrt (- 1.0 (/ (* (* h (* t_0 t_1)) (pow t_1 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 t_0 = (M * D) / (2.0 * d);
double tmp;
if ((pow(t_0, 2.0) * (h / l)) <= -((double) INFINITY)) {
tmp = w0 * (D * sqrt(((h * (M * M)) / (l * (d * d))) * -0.25));
} else {
double t_1 = cbrt(t_0);
tmp = w0 * sqrt(1.0 - (((h * (t_0 * t_1)) * pow(t_1, 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 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < -inf.0Initial program 64.0
Taylor expanded around inf 56.8
Simplified56.8
if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) Initial program 6.7
rmApplied *-commutative_binary646.7
Applied associate-*l/_binary643.4
Simplified3.4
rmApplied add-cube-cbrt_binary643.4
Applied unpow-prod-down_binary643.4
Applied associate-*r*_binary642.4
Simplified2.4
Final simplification9.6
herbie shell --seed 2021211
(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))))))