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 ((A / (V * l)) <= 3.5885075091003e-311) {
tmp = c0 * sqrt((A / V) / l);
} else if ((A / (V * l)) <= 4.541364065875616e+302) {
tmp = sqrt(sqrt(A / (V * l))) * (c0 * sqrt(sqrt(A / (V * l))));
} else {
tmp = c0 * (sqrt((cbrt(A) * cbrt(A)) / V) * sqrt(cbrt(A) / l));
}
return tmp;
}



Bits error versus c0



Bits error versus A



Bits error versus V



Bits error versus l
Results
if (/ A (* V l)) < 3.58850750910027e-311Initial program 40.3
rmApplied associate-/r*30.2
if 3.58850750910027e-311 < (/ A (* V l)) < 4.54136406587561631e302Initial program 0.5
rmApplied add-sqr-sqrt0.5
Applied sqrt-prod0.8
Applied associate-*r*0.8
Simplified0.8
if 4.54136406587561631e302 < (/ A (* V l)) Initial program 62.7
rmApplied add-cube-cbrt62.7
Applied times-frac49.7
Applied sqrt-prod42.3
Final simplification13.8
herbie shell --seed 2020338
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))