c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -9.508350842983625 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot {\left(e^{0.25 \cdot \left(\log \left(\frac{A}{V}\right) - \log \ell\right)}\right)}^{2}\\
\mathbf{elif}\;V \cdot \ell \leq -8.825750467531032 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot {\left(e^{0.25 \cdot \left(\log \left(\frac{{\left(\sqrt[3]{-1}\right)}^{3}}{V \cdot \ell}\right) - \log \left(\frac{-1}{A}\right)\right)}\right)}^{2}\\
\mathbf{elif}\;V \cdot \ell \leq 2.96 \cdot 10^{-322} \lor \neg \left(V \cdot \ell \leq 1.794321740595174 \cdot 10^{+302}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\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) -9.508350842983625e+299)
(* c0 (pow (exp (* 0.25 (- (log (/ A V)) (log l)))) 2.0))
(if (<= (* V l) -8.825750467531032e-304)
(*
c0
(pow
(exp
(* 0.25 (- (log (/ (pow (cbrt -1.0) 3.0) (* V l))) (log (/ -1.0 A)))))
2.0))
(if (or (<= (* V l) 2.96e-322) (not (<= (* V l) 1.794321740595174e+302)))
(* c0 (sqrt (/ (/ A l) V)))
(* 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) <= -9.508350842983625e+299) {
tmp = c0 * pow(exp(0.25 * (log(A / V) - log(l))), 2.0);
} else if ((V * l) <= -8.825750467531032e-304) {
tmp = c0 * pow(exp(0.25 * (log(pow(cbrt(-1.0), 3.0) / (V * l)) - log(-1.0 / A))), 2.0);
} else if (((V * l) <= 2.96e-322) || !((V * l) <= 1.794321740595174e+302)) {
tmp = c0 * sqrt((A / l) / V);
} 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) < -9.5083508429836249e299Initial program 40.8
Applied add-cube-cbrt_binary6440.9
Applied times-frac_binary6422.9
Applied add-cube-cbrt_binary6423.0
Applied pow3_binary6423.0
Applied add-sqr-sqrt_binary6423.0
Applied pow2_binary6423.0
Taylor expanded in l around 0 12.9
if -9.5083508429836249e299 < (*.f64 V l) < -8.8257504675310316e-304Initial program 10.2
Applied add-cube-cbrt_binary6410.7
Applied times-frac_binary6415.1
Applied add-cube-cbrt_binary6415.3
Applied pow3_binary6415.3
Applied add-sqr-sqrt_binary6415.3
Applied pow2_binary6415.3
Taylor expanded in A around -inf 5.3
if -8.8257504675310316e-304 < (*.f64 V l) < 2.96439e-322 or 1.794321740595174e302 < (*.f64 V l) Initial program 51.4
Applied add-cube-cbrt_binary6451.4
Applied times-frac_binary6430.4
Applied associate-*l/_binary6430.4
Simplified30.2
if 2.96439e-322 < (*.f64 V l) < 1.794321740595174e302Initial program 10.7
Applied sqrt-div_binary640.7
Final simplification8.0
herbie shell --seed 2021215
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))