double code(double a1, double a2, double b1, double b2) {
return ((double) (((double) (a1 * a2)) / ((double) (b1 * b2))));
}
double code(double a1, double a2, double b1, double b2) {
double VAR;
if ((((double) (((double) (a1 * a2)) / ((double) (b1 * b2)))) <= -inf.0)) {
VAR = ((double) (((double) (a1 * ((double) (((double) cbrt(a2)) * ((double) (((double) cbrt(a2)) / b1)))))) * ((double) (((double) cbrt(a2)) / b2))));
} else {
double VAR_1;
if (((((double) (((double) (a1 * a2)) / ((double) (b1 * b2)))) <= -1.6034023183853988e-284) || (!(((double) (((double) (a1 * a2)) / ((double) (b1 * b2)))) <= 0.0) && (((double) (((double) (a1 * a2)) / ((double) (b1 * b2)))) <= 4.350432120882198e+256)))) {
VAR_1 = ((double) (((double) (a1 * a2)) / ((double) (b1 * b2))));
} else {
VAR_1 = ((double) (a1 * ((double) (((double) (a2 / b2)) / b1))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus a1




Bits error versus a2




Bits error versus b1




Bits error versus b2
Results
| Original | 11.3 |
|---|---|
| Target | 11.2 |
| Herbie | 3.4 |
if (/ (* a1 a2) (* b1 b2)) < -inf.0Initial program 64.0
Simplified30.3
rmApplied add-cube-cbrt30.8
Applied times-frac17.0
Applied associate-*r*11.1
Simplified11.1
if -inf.0 < (/ (* a1 a2) (* b1 b2)) < -1.6034023183853988e-284 or 0.0 < (/ (* a1 a2) (* b1 b2)) < 4.35043212088219816e256Initial program 0.8
if -1.6034023183853988e-284 < (/ (* a1 a2) (* b1 b2)) < 0.0 or 4.35043212088219816e256 < (/ (* a1 a2) (* b1 b2)) Initial program 21.5
Simplified14.3
rmApplied add-cube-cbrt14.5
Applied times-frac6.3
Simplified6.3
rmApplied associate-*r/6.3
Applied associate-*l/6.7
Simplified6.4
Final simplification3.4
herbie shell --seed 2020181
(FPCore (a1 a2 b1 b2)
:name "Quotient of products"
:precision binary64
:herbie-target
(* (/ a1 b1) (/ a2 b2))
(/ (* a1 a2) (* b1 b2)))