x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -1.9975742700347867 \cdot 10^{-153}:\\
\;\;\;\;x + \frac{y - x}{\left(a - t\right) \cdot \frac{1}{z - t}}\\
\mathbf{elif}\;a \le -5.7590695335687623 \cdot 10^{-202}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\
\mathbf{elif}\;a \le -2.51426370931477275 \cdot 10^{-256}:\\
\;\;\;\;x + \frac{\frac{y - x}{a - t}}{\frac{1}{z - t}}\\
\mathbf{elif}\;a \le 1.82900585396431584 \cdot 10^{-137}:\\
\;\;\;\;\left(y + \frac{x \cdot z}{t}\right) - \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z - t}{a - t}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - x) * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((a <= -1.9975742700347867e-153)) {
VAR = (x + ((y - x) / ((a - t) * (1.0 / (z - t)))));
} else {
double VAR_1;
if ((a <= -5.759069533568762e-202)) {
VAR_1 = ((y + ((x * z) / t)) - ((z * y) / t));
} else {
double VAR_2;
if ((a <= -2.5142637093147727e-256)) {
VAR_2 = (x + (((y - x) / (a - t)) / (1.0 / (z - t))));
} else {
double VAR_3;
if ((a <= 1.8290058539643158e-137)) {
VAR_3 = ((y + ((x * z) / t)) - ((z * y) / t));
} else {
VAR_3 = (x + ((y - x) * ((z - t) / (a - t))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
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 | 25.0 |
|---|---|
| Target | 9.6 |
| Herbie | 11.0 |
if a < -1.9975742700347867e-153Initial program 23.7
rmApplied associate-/l*9.6
rmApplied div-inv9.6
if -1.9975742700347867e-153 < a < -5.759069533568762e-202 or -2.5142637093147727e-256 < a < 1.8290058539643158e-137Initial program 28.7
Taylor expanded around inf 13.6
if -5.759069533568762e-202 < a < -2.5142637093147727e-256Initial program 29.4
rmApplied associate-/l*20.3
rmApplied div-inv20.4
Applied associate-/r*27.0
if 1.8290058539643158e-137 < a Initial program 23.9
rmApplied *-un-lft-identity23.9
Applied times-frac9.6
Simplified9.6
Final simplification11.0
herbie shell --seed 2020106
(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) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))