c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\begin{array}{l}
\mathbf{if}\;V \cdot \ell \le -2.6220125092199022 \cdot 10^{-97}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\right) \cdot \sqrt{\sqrt{\frac{A}{V \cdot \ell}}}\\
\mathbf{elif}\;V \cdot \ell \le 3.80431 \cdot 10^{-322}:\\
\;\;\;\;\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0\\
\mathbf{elif}\;V \cdot \ell \le 1.93687473196227216 \cdot 10^{296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{V} \cdot \frac{A}{\ell}} \cdot c0\\
\end{array}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 temp;
if (((V * l) <= -2.622012509219902e-97)) {
temp = ((c0 * sqrt(sqrt((A / (V * l))))) * sqrt(sqrt((A / (V * l)))));
} else {
double temp_1;
if (((V * l) <= 3.8043054729776e-322)) {
temp_1 = (sqrt(((A / V) / l)) * c0);
} else {
double temp_2;
if (((V * l) <= 1.936874731962272e+296)) {
temp_2 = (c0 * (sqrt(A) / sqrt((V * l))));
} else {
temp_2 = (sqrt(((1.0 / V) * (A / l))) * c0);
}
temp_1 = temp_2;
}
temp = temp_1;
}
return temp;
}



Bits error versus c0



Bits error versus A



Bits error versus V



Bits error versus l
Results
if (* V l) < -2.622012509219902e-97Initial program 13.7
rmApplied add-sqr-sqrt13.7
Applied sqrt-prod13.9
Applied associate-*r*13.9
if -2.622012509219902e-97 < (* V l) < 3.8043054729776e-322Initial program 35.7
rmApplied *-commutative35.7
rmApplied associate-/r*26.4
if 3.8043054729776e-322 < (* V l) < 1.936874731962272e+296Initial program 10.7
rmApplied sqrt-div0.7
if 1.936874731962272e+296 < (* V l) Initial program 39.7
rmApplied *-commutative39.7
rmApplied *-un-lft-identity39.7
Applied times-frac23.5
Final simplification12.1
herbie shell --seed 2020057 +o rules:numerics
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))