w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\begin{array}{l}
\mathbf{if}\;\frac{h}{\ell} \leq -7.111607855480492 \cdot 10^{+101}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \left(h \cdot {\left(\frac{M}{\frac{2}{\frac{D}{d}}}\right)}^{2}\right) \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;\frac{h}{\ell} \leq -1.5631206412634186 \cdot 10^{-256}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{M \cdot D}{2 \cdot d} \cdot \left(\frac{h}{\ell} \cdot \frac{M \cdot D}{2 \cdot d}\right)}\\
\mathbf{else}:\\
\;\;\;\;w0\\
\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 (<= (/ h l) -7.111607855480492e+101)
(* w0 (sqrt (- 1.0 (* (* h (pow (/ M (/ 2.0 (/ D d))) 2.0)) (/ 1.0 l)))))
(if (<= (/ h l) -1.5631206412634186e-256)
(*
w0
(sqrt
(- 1.0 (* (/ (* M D) (* 2.0 d)) (* (/ h l) (/ (* M D) (* 2.0 d)))))))
w0)))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 ((h / l) <= -7.111607855480492e+101) {
tmp = w0 * sqrt(1.0 - ((h * pow((M / (2.0 / (D / d))), 2.0)) * (1.0 / l)));
} else if ((h / l) <= -1.5631206412634186e-256) {
tmp = w0 * sqrt(1.0 - (((M * D) / (2.0 * d)) * ((h / l) * ((M * D) / (2.0 * d)))));
} else {
tmp = w0;
}
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 h l) < -7.11160785548049185e101Initial program 31.1
rmApplied div-inv_binary64_143931.1
Applied associate-*r*_binary64_138218.8
Simplified18.8
rmApplied associate-/l*_binary64_138718.3
Simplified18.3
if -7.11160785548049185e101 < (/.f64 h l) < -1.5631206412634186e-256Initial program 13.7
rmApplied unpow2_binary64_150713.7
Applied associate-*l*_binary64_138311.6
if -1.5631206412634186e-256 < (/.f64 h l) Initial program 8.0
Taylor expanded around 0 3.2
Final simplification8.7
herbie shell --seed 2020342
(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))))))