x + y \cdot \frac{z - t}{z - a}\begin{array}{l}
\mathbf{if}\;y \leq -1.3317419386399715 \cdot 10^{+49}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;y \leq 1.2024395009174756 \cdot 10^{-76}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\frac{z}{z - a} - \frac{t}{z - a}\right)\\
\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 (<= y -1.3317419386399715e+49)
(+ x (* y (/ (- z t) (- z a))))
(if (<= y 1.2024395009174756e-76)
(+ x (/ (* y (- z t)) (- z a)))
(+ x (* y (- (/ z (- z a)) (/ 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 <= -1.3317419386399715e+49) {
tmp = x + (y * ((z - t) / (z - a)));
} else if (y <= 1.2024395009174756e-76) {
tmp = x + ((y * (z - t)) / (z - a));
} else {
tmp = x + (y * ((z / (z - a)) - (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.4 |
|---|---|
| Target | 1.2 |
| Herbie | 0.6 |
if y < -1.3317419386399715e49Initial program 0.6
if -1.3317419386399715e49 < y < 1.20243950091747565e-76Initial program 2.1
rmApplied associate-*r/_binary64_133190.5
if 1.20243950091747565e-76 < y Initial program 0.6
rmApplied div-sub_binary64_133820.6
Final simplification0.6
herbie shell --seed 2020308
(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)))))