x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \le -8.27012852365464511 \cdot 10^{43} \lor \neg \left(y \le 4.59337790585326484 \cdot 10^{-23}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (y * ((z - t) / (z - a))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((y <= -8.270128523654645e+43) || !(y <= 4.593377905853265e-23))) {
VAR = (x + (y * ((z - t) / (z - a))));
} else {
VAR = (x + ((y * (z - t)) / (z - a)));
}
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.3 |
|---|---|
| Target | 1.2 |
| Herbie | 0.5 |
if y < -8.270128523654645e+43 or 4.593377905853265e-23 < y Initial program 0.4
if -8.270128523654645e+43 < y < 4.593377905853265e-23Initial program 2.0
rmApplied associate-*r/0.7
Final simplification0.5
herbie shell --seed 2020106
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))