double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
double tmp;
if ((l <= 1.0097243451344419e-288) || !(l <= 8.16851537488987e-179)) {
tmp = (pow((cbrt(d) * cbrt(d)), (1.0 / 2.0)) * (pow(cbrt(cbrt(d) * cbrt(d)), (1.0 / 2.0)) * pow((cbrt(cbrt(d)) / h), (1.0 / 2.0)))) * ((pow((1.0 / (cbrt(l) * cbrt(l))), (1.0 / 2.0)) * pow((d / cbrt(l)), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l))));
} else {
tmp = 1.0 * ((pow(1.0, 1.0) * pow(d, 1.0)) * pow((1.0 / (pow((pow(1.0, 1.0) * pow(l, 1.0)), 1.0) * pow((pow(1.0, 1.0) * pow(h, 1.0)), 1.0))), 0.5));
}
return tmp;
}



Bits error versus d



Bits error versus h



Bits error versus l



Bits error versus M



Bits error versus D
Results
if l < 1.00972434513444187e-288 or 8.1685153748898703e-179 < l Initial program 26.2
rmApplied add-cube-cbrt26.4
Applied *-un-lft-identity26.4
Applied times-frac26.4
Applied unpow-prod-down22.3
rmApplied *-un-lft-identity22.3
Applied add-cube-cbrt22.5
Applied times-frac22.5
Applied unpow-prod-down17.8
Simplified17.8
rmApplied *-un-lft-identity17.8
Applied add-cube-cbrt17.8
Applied cbrt-prod17.9
Applied times-frac17.9
Applied unpow-prod-down16.9
Simplified16.9
rmApplied associate-*l*16.4
if 1.00972434513444187e-288 < l < 8.1685153748898703e-179Initial program 37.6
Taylor expanded around 0 38.3
Simplified35.8
Final simplification17.5
herbie shell --seed 2020338
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))