x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -4.1081096876749744 \cdot 10^{-250} \lor \neg \left(y \leq 7.73500297203524 \cdot 10^{+18}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.1081096876749744e-250) (not (<= y 7.73500297203524e+18))) (+ x (* y (/ (- z t) (- z a)))) (+ x (/ (* y (- z t)) (- z a)))))
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 tmp;
if ((y <= -4.1081096876749744e-250) || !(y <= 7.73500297203524e+18)) {
tmp = x + (y * ((z - t) / (z - a)));
} else {
tmp = x + ((y * (z - t)) / (z - a));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 1.2 |
|---|---|
| Target | 1.1 |
| Herbie | 0.7 |
if y < -4.1081096876749744e-250 or 7735002972035239900 < y Initial program 0.8
if -4.1081096876749744e-250 < y < 7735002972035239900Initial program 1.9
Simplified0.3
Final simplification0.7
herbie shell --seed 2021176
(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)))))