x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;y \le -2.060365571784887 \cdot 10^{-22}:\\
\;\;\;\;x + \frac{y}{a - t} \cdot \left(z - t\right)\\
\mathbf{elif}\;y \le 6.1636889221917999 \cdot 10^{-12}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\left(z - t\right) \cdot \frac{1}{a - t}\right)\\
\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 <= -2.060365571784887e-22)) {
VAR = ((double) (x + ((double) ((y / ((double) (a - t))) * ((double) (z - t))))));
} else {
double VAR_1;
if ((y <= 6.1636889221918e-12)) {
VAR_1 = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - t)))));
} else {
VAR_1 = ((double) (x + ((double) (y * ((double) (((double) (z - t)) * (1.0 / ((double) (a - 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 | 1.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.8 |
if y < -2.060365571784887e-22Initial program 0.5
rmApplied pow10.5
Applied pow10.5
Applied pow-prod-down0.5
Simplified2.2
if -2.060365571784887e-22 < y < 6.1636889221917999e-12Initial program 2.3
rmApplied associate-*r/0.3
if 6.1636889221917999e-12 < y Initial program 0.5
rmApplied div-inv0.6
Final simplification0.8
herbie shell --seed 2020182
(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)))))