c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1.75142386 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot {\left(e^{0.25 \cdot \left(\log \left(\frac{-A}{\ell}\right) + \log \left(\frac{-1}{V}\right)\right)}\right)}^{2}\\
\mathbf{elif}\;V \cdot \ell \leq 5.970120430153575 \cdot 10^{+246}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1.75142386e-315)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(* c0 (pow (exp (* 0.25 (+ (log (/ (- A) l)) (log (/ -1.0 V))))) 2.0))
(if (<= (* V l) 5.970120430153575e+246)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))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) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1.75142386e-315) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * pow(exp((0.25 * (log((-A / l)) + log((-1.0 / V))))), 2.0);
} else if ((V * l) <= 5.970120430153575e+246) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}



Bits error versus c0



Bits error versus A



Bits error versus V



Bits error versus l
Results
if (*.f64 V l) < -inf.0Initial program 41.4
Applied egg-rr10.3
if -inf.0 < (*.f64 V l) < -1.751423861e-315Initial program 10.3
Applied egg-rr0.5
if -1.751423861e-315 < (*.f64 V l) < 0.0Initial program 63.2
Applied egg-rr38.5
Applied egg-rr38.6
Taylor expanded in V around -inf 34.8
if 0.0 < (*.f64 V l) < 5.9701204301535753e246Initial program 9.8
Applied egg-rr0.7
if 5.9701204301535753e246 < (*.f64 V l) Initial program 33.8
Applied egg-rr20.0
Applied egg-rr19.8
Final simplification6.2
herbie shell --seed 2022125
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))