double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= -1.8720817586345306e-286) || !(((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= 0.0))) {
VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (((double) (z - t)) * ((double) (1.0 / ((double) (a - t))))))))));
} else {
VAR = ((double) (y + ((double) (((double) (z * ((double) (x / t)))) - ((double) (y * ((double) (z / t))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.6 |
|---|---|
| Target | 9.6 |
| Herbie | 9.1 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -1.87208175863453059e-286 or 0.0 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 21.5
Simplified7.8
rmApplied div-inv7.9
if -1.87208175863453059e-286 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 0.0Initial program 59.0
Simplified59.1
Taylor expanded around inf 20.3
Simplified22.3
Final simplification9.1
herbie shell --seed 2020191
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1.0) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))