c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2.2350651313941505 \cdot 10^{+102}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -3.7060305688441786 \cdot 10^{-194}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{\sqrt[3]{A} \cdot \sqrt[3]{A}}{V}}\right) \cdot \sqrt{\frac{\sqrt[3]{A}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2.2350651313941505e+102)
(* c0 (sqrt (/ 1.0 (/ V (/ A l)))))
(if (<= (* V l) -3.7060305688441786e-194)
(* c0 (* (sqrt (sqrt (/ A (* V l)))) (sqrt (sqrt (/ A (* V l))))))
(if (<= (* V l) 0.0)
(* (* c0 (sqrt (/ (* (cbrt A) (cbrt A)) V))) (sqrt (/ (cbrt A) l)))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))double code(double c0, double A, double V, double l) {
return c0 * sqrt(A / (V * l));
}
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2.2350651313941505e+102) {
tmp = c0 * sqrt(1.0 / (V / (A / l)));
} else if ((V * l) <= -3.7060305688441786e-194) {
tmp = c0 * (sqrt(sqrt(A / (V * l))) * sqrt(sqrt(A / (V * l))));
} else if ((V * l) <= 0.0) {
tmp = (c0 * sqrt((cbrt(A) * cbrt(A)) / V)) * sqrt(cbrt(A) / l);
} else {
tmp = c0 * (sqrt(A) / sqrt(V * l));
}
return tmp;
}



Bits error versus c0



Bits error versus A



Bits error versus V



Bits error versus l
Results
if (*.f64 V l) < -2.2350651313941505e102Initial program 24.3
rmApplied clear-num_binary6424.7
Simplified19.6
if -2.2350651313941505e102 < (*.f64 V l) < -3.7060305688441786e-194Initial program 5.3
rmApplied add-sqr-sqrt_binary645.3
Applied sqrt-prod_binary645.6
if -3.7060305688441786e-194 < (*.f64 V l) < 0.0Initial program 47.6
rmApplied add-cube-cbrt_binary6447.8
Applied times-frac_binary6432.2
Applied sqrt-prod_binary6438.8
Applied associate-*r*_binary6439.1
Simplified39.1
if 0.0 < (*.f64 V l) Initial program 14.7
rmApplied sqrt-div_binary646.3
Final simplification13.2
herbie shell --seed 2020219
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))