\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -6.6367866399476112 \cdot 10^{-99} \lor \neg \left(a \le 1.5391631179144392 \cdot 10^{-246}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z - t}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\
\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 temp;
if (((a <= -6.636786639947611e-99) || !(a <= 1.5391631179144392e-246))) {
temp = (x + (y * (1.0 - ((z - t) / (a - t)))));
} else {
temp = (((z * y) / t) + x);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.0 |
|---|---|
| Target | 8.6 |
| Herbie | 7.0 |
if a < -6.636786639947611e-99 or 1.5391631179144392e-246 < a Initial program 15.2
rmApplied associate-/l*9.9
rmApplied div-inv10.0
Applied associate-/r*9.2
rmApplied associate--l+6.8
Simplified6.3
if -6.636786639947611e-99 < a < 1.5391631179144392e-246Initial program 19.4
Taylor expanded around inf 9.6
Final simplification7.0
herbie shell --seed 2020057
(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))))