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 (((t <= -4.600313077092651e+94) || !(t <= 4.401597097352974e+240))) {
VAR = ((double) (y + ((double) (((double) (((double) (x / t)) * z)) - ((double) (y * ((double) (z / t))))))));
} else {
VAR = ((double) (x + ((double) (((double) (y - x)) * ((double) (((double) (z - t)) / ((double) (a - 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.4 |
|---|---|
| Target | 9.4 |
| Herbie | 10.2 |
if t < -4.600313077092651e94 or 4.40159709735297392e240 < t Initial program 45.1
Simplified21.9
rmApplied *-un-lft-identity21.9
Applied add-cube-cbrt22.7
Applied times-frac22.7
Simplified22.7
Taylor expanded around inf 26.3
Simplified16.6
if -4.600313077092651e94 < t < 4.40159709735297392e240Initial program 17.0
Simplified8.0
Final simplification10.2
herbie shell --seed 2020179
(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))))