\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -2.5508524678139594 \cdot 10^{-129}:\\
\;\;\;\;\left(\left(x + y\right) - \frac{z}{\frac{a - t}{y}}\right) + \frac{t}{\frac{a - t}{y}}\\
\mathbf{elif}\;a \le 2.970242852533054 \cdot 10^{-70}:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{a - t} \cdot y\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((x + y) - (((z - t) * y) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((a <= -2.5508524678139594e-129)) {
VAR = (((x + y) - (z / ((a - t) / y))) + (t / ((a - t) / y)));
} else {
double VAR_1;
if ((a <= 2.970242852533054e-70)) {
VAR_1 = (((z * y) / t) + x);
} else {
VAR_1 = ((x + y) - (((z - t) / (a - t)) * 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 | 16.4 |
|---|---|
| Target | 8.5 |
| Herbie | 9.6 |
if a < -2.5508524678139594e-129Initial program 15.6
rmApplied associate-/l*9.6
rmApplied div-sub9.6
Applied associate--r-9.6
if -2.5508524678139594e-129 < a < 2.970242852533054e-70Initial program 20.0
Taylor expanded around inf 11.6
if 2.970242852533054e-70 < a Initial program 13.9
rmApplied associate-/l*8.5
rmApplied associate-/r/7.6
Final simplification9.6
herbie shell --seed 2020102
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))