x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -530501686562953.62 \lor \neg \left(y \le 9.22165466596635165 \cdot 10^{59}\right):\\
\;\;\;\;x + y \cdot \left(\frac{z}{a - t} - \frac{t}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (a - t)))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((y <= -530501686562953.6) || !(y <= 9.221654665966352e+59))) {
VAR = ((double) (x + ((double) (y * ((double) ((z / ((double) (a - t))) - (t / ((double) (a - t)))))))));
} else {
VAR = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - t)))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.5 |
|---|---|
| Target | 0.5 |
| Herbie | 0.7 |
if y < -530501686562953.62 or 9.22165466596635165e59 < y Initial program 0.6
rmApplied div-sub0.6
if -530501686562953.62 < y < 9.22165466596635165e59Initial program 2.1
rmApplied associate-*r/0.7
Final simplification0.7
herbie shell --seed 2020181
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))