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)))))) <= -4.639554587483571e-281) || !(((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= 1.2826677504057426e-290))) {
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.2 |
|---|---|
| Target | 9.4 |
| Herbie | 8.8 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -4.63955458748357079e-281 or 1.28267e-290 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 21.0
Simplified7.2
rmApplied div-inv7.3
if -4.63955458748357079e-281 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 1.28267e-290Initial program 57.2
Simplified56.7
Taylor expanded around inf 21.4
Simplified24.0
Final simplification8.8
herbie shell --seed 2020190
(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))))