x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \le -5.00876388733083853 \cdot 10^{52}:\\
\;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\
\mathbf{elif}\;y \le 7.5879717494487083 \cdot 10^{-165}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((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.008763887330839e+52)) {
VAR = ((double) (x + ((double) ((y / ((double) (z - a))) * ((double) (z - t))))));
} else {
double VAR_1;
if ((y <= 7.587971749448708e-165)) {
VAR_1 = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (z - a)))));
} else {
VAR_1 = ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (z - a)))))));
}
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.5 |
|---|---|
| Target | 1.4 |
| Herbie | 1.3 |
if y < -5.00876388733083853e52Initial program 0.6
rmApplied pow10.6
Applied pow10.6
Applied pow-prod-down0.6
Simplified3.3
if -5.00876388733083853e52 < y < 7.5879717494487083e-165Initial program 2.3
rmApplied associate-*r/0.7
if 7.5879717494487083e-165 < y Initial program 1.0
Final simplification1.3
herbie shell --seed 2020182
(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)))))