double code(double x, double y, double z, double t, double a) {
return ((double) (x - ((double) (((double) (y * ((double) (z - t)))) / a))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((double) (y * ((double) (z - t)))) <= -1.962693662107902e+159)) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (t - z)) / a))))));
} else {
double VAR_1;
if ((((double) (y * ((double) (z - t)))) <= 1.3288961013855822e+224)) {
VAR_1 = ((double) (x - ((double) (1.0 / ((double) (a / ((double) (y * ((double) (z - t))))))))));
} else {
VAR_1 = ((double) (x - ((double) (((double) (z - t)) * ((double) (y / a))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 6.4 |
|---|---|
| Target | 0.9 |
| Herbie | 0.7 |
if (* y (- z t)) < -1.962693662107902e159Initial program 22.2
Simplified1.8
if -1.962693662107902e159 < (* y (- z t)) < 1.32889610138558224e224Initial program 0.5
rmApplied clear-num0.5
if 1.32889610138558224e224 < (* y (- z t)) Initial program 34.3
rmApplied add-cube-cbrt34.6
Applied associate-/r*34.6
Simplified9.3
rmApplied *-un-lft-identity9.3
Applied cbrt-prod9.3
Applied times-frac1.2
Simplified1.2
Simplified0.4
Final simplification0.7
herbie shell --seed 2020180
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))