x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;y \le -5.06099590898589243 \cdot 10^{40}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\mathbf{elif}\;y \le 218631.804416377243:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((y <= -5.060995908985892e+40)) {
VAR = ((double) (x + ((double) (y / ((double) (((double) (z - a)) / ((double) (z - t))))))));
} else {
double VAR_1;
if ((y <= 218631.80441637724)) {
VAR_1 = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) * ((double) (1.0 / ((double) (z - a))))))));
} else {
VAR_1 = ((double) (x + ((double) (((double) (y / ((double) (z - a)))) * ((double) (z - t))))));
}
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 | 10.5 |
|---|---|
| Target | 1.3 |
| Herbie | 0.9 |
if y < -5.06099590898589243e40Initial program 25.5
rmApplied associate-/l*0.7
if -5.06099590898589243e40 < y < 218631.804416377243Initial program 0.3
rmApplied div-inv0.4
if 218631.804416377243 < y Initial program 23.1
rmApplied associate-/l*0.6
rmApplied associate-/r/2.4
Final simplification0.9
herbie shell --seed 2020173
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))