x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -4.600313077092651 \cdot 10^{94}:\\
\;\;\;\;y + \left(\frac{x}{t} \cdot z - y \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t \le 1.53283743298691262 \cdot 10^{239}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;y + \frac{z}{t} \cdot \left(x - y\right)\\
\end{array}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)) {
VAR = ((double) (y + ((double) (((double) (((double) (x / t)) * z)) - ((double) (y * ((double) (z / t))))))));
} else {
double VAR_1;
if ((t <= 1.5328374329869126e+239)) {
VAR_1 = ((double) (x + ((double) (((double) (y - x)) * ((double) (((double) (z - t)) / ((double) (a - t))))))));
} else {
VAR_1 = ((double) (y + ((double) (((double) (z / t)) * ((double) (x - y))))));
}
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 | 24.4 |
|---|---|
| Target | 9.4 |
| Herbie | 10.2 |
if t < -4.600313077092651e94Initial program 43.0
Simplified20.2
rmApplied *-un-lft-identity20.2
Applied add-cube-cbrt20.9
Applied times-frac21.0
Simplified21.0
Taylor expanded around inf 27.2
Simplified18.2
if -4.600313077092651e94 < t < 1.53283743298691262e239Initial program 17.0
Simplified8.0
if 1.53283743298691262e239 < t Initial program 51.0
Simplified26.4
Taylor expanded around inf 23.9
Simplified11.5
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))))