w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\begin{array}{l}
\mathbf{if}\;\frac{M \cdot D}{2 \cdot d} \leq -2.953975599281222 \cdot 10^{-29}:\\
\;\;\;\;w0 \cdot \sqrt{1 - {\left(\sqrt[3]{\frac{M \cdot D}{2 \cdot d}} \cdot \sqrt[3]{\frac{M \cdot D}{2 \cdot d}}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{\sqrt[3]{M \cdot D}}{\sqrt[3]{2 \cdot d}}\right)}^{2}\right)}\\
\mathbf{elif}\;\frac{M \cdot D}{2 \cdot d} \leq 1.5031648947369 \cdot 10^{-311}:\\
\;\;\;\;w0 \cdot \sqrt[3]{{\left(\sqrt{1 - \frac{h \cdot {\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2}}{\ell}}\right)}^{3}}\\
\mathbf{elif}\;\frac{M \cdot D}{2 \cdot d} \leq 2.829330713947476 \cdot 10^{+236}:\\
\;\;\;\;w0 \cdot \sqrt{1 - {\left(\sqrt{\frac{M \cdot D}{2 \cdot d}}\right)}^{2} \cdot \left(\frac{M \cdot D}{2 \cdot d} \cdot \frac{h}{\ell}\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 (<= (/ (* M D) (* 2.0 d)) -2.953975599281222e-29)
(*
w0
(sqrt
(-
1.0
(*
(pow (* (cbrt (/ (* M D) (* 2.0 d))) (cbrt (/ (* M D) (* 2.0 d)))) 2.0)
(* (/ h l) (pow (/ (cbrt (* M D)) (cbrt (* 2.0 d))) 2.0))))))
(if (<= (/ (* M D) (* 2.0 d)) 1.5031648947369e-311)
(*
w0
(cbrt
(pow (sqrt (- 1.0 (/ (* h (pow (* (/ M 2.0) (/ D d)) 2.0)) l))) 3.0)))
(if (<= (/ (* M D) (* 2.0 d)) 2.829330713947476e+236)
(*
w0
(sqrt
(-
1.0
(*
(pow (sqrt (/ (* M D) (* 2.0 d))) 2.0)
(* (/ (* M D) (* 2.0 d)) (/ h l))))))
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 (((M * D) / (2.0 * d)) <= -2.953975599281222e-29) {
tmp = w0 * sqrt(1.0 - (pow((cbrt((M * D) / (2.0 * d)) * cbrt((M * D) / (2.0 * d))), 2.0) * ((h / l) * pow((cbrt(M * D) / cbrt(2.0 * d)), 2.0))));
} else if (((M * D) / (2.0 * d)) <= 1.5031648947369e-311) {
tmp = w0 * cbrt(pow(sqrt(1.0 - ((h * pow(((M / 2.0) * (D / d)), 2.0)) / l)), 3.0));
} else if (((M * D) / (2.0 * d)) <= 2.829330713947476e+236) {
tmp = w0 * sqrt(1.0 - (pow(sqrt((M * D) / (2.0 * d)), 2.0) * (((M * D) / (2.0 * d)) * (h / l))));
} 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 (*.f64 M D) (*.f64 2 d)) < -2.95399e-29Initial program 32.4
rmApplied add-cube-cbrt_binary6432.5
Applied unpow-prod-down_binary6432.5
Applied associate-*l*_binary6428.1
Simplified28.1
rmApplied cbrt-div_binary6428.0
if -2.95399e-29 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 1.50317e-311Initial program 6.9
rmApplied div-inv_binary646.9
Applied associate-*r*_binary640.8
rmApplied add-cbrt-cube_binary641.0
Simplified0.9
if 1.50317e-311 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 2.82931e236Initial program 11.0
rmApplied add-sqr-sqrt_binary6411.0
Applied unpow-prod-down_binary6411.0
Applied associate-*l*_binary648.2
Simplified8.2
if 2.82931e236 < (/.f64 (*.f64 M D) (*.f64 2 d)) Initial program 64.0
Taylor expanded around 0 55.7
Final simplification9.7
herbie shell --seed 2020231
(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))))))