\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -1.8190142657740654 \cdot 10^{-22} \lor \neg \left(y \le 3.11797660037939162 \cdot 10^{-12}\right):\\
\;\;\;\;x + \left(y + y \cdot \left(\left(t - z\right) \cdot \frac{1}{a - t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \frac{1}{a - t} \cdot \left(y \cdot \left(t - z\right)\right)\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (x + y)) - (((double) (((double) (z - t)) * y)) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((y <= -1.8190142657740654e-22) || !(y <= 3.1179766003793916e-12))) {
VAR = ((double) (x + ((double) (y + ((double) (y * ((double) (((double) (t - z)) * (1.0 / ((double) (a - t)))))))))));
} else {
VAR = ((double) (x + ((double) (y + ((double) ((1.0 / ((double) (a - t))) * ((double) (y * ((double) (t - z))))))))));
}
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.8 |
|---|---|
| Target | 8.6 |
| Herbie | 7.5 |
if y < -1.8190142657740654e-22 or 3.11797660037939162e-12 < y Initial program 29.9
Simplified12.1
rmApplied div-inv12.9
if -1.8190142657740654e-22 < y < 3.11797660037939162e-12Initial program 4.1
Simplified3.7
rmApplied div-inv4.2
Applied associate-*r*2.4
Final simplification7.5
herbie shell --seed 2020182
(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.0 (- 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.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))