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 (((a <= -5.1545916501600656e-51) || !(a <= 3.17042561904086e-84))) {
VAR = ((double) (x + ((double) (((double) (y - x)) / ((double) (((double) (a - t)) / ((double) (z - t))))))));
} else {
VAR = ((double) (y + ((double) (((double) (z / t)) * ((double) (x - y))))));
}
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.2 |
|---|---|
| Target | 9.1 |
| Herbie | 9.5 |
if a < -5.15459165016006555e-51 or 3.1704256190408599e-84 < a Initial program 22.2
Simplified7.4
rmApplied clear-num7.5
rmApplied un-div-inv7.4
if -5.15459165016006555e-51 < a < 3.1704256190408599e-84Initial program 27.8
Simplified18.9
Taylor expanded around inf 18.3
Simplified13.1
Final simplification9.5
herbie shell --seed 2020180
(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))))