x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;y \leq -1.903298031775812 \cdot 10^{+79}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a - t}\\
\mathbf{elif}\;y \leq 5.328190999737839 \cdot 10^{-77}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.903298031775812e+79)
(+ x (* y (/ (- z t) (- a t))))
(if (<= y 5.328190999737839e-77)
(+ x (/ (* y (- z t)) (- a t)))
(+ x (/ y (/ (- a t) (- z t)))))))double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.903298031775812e+79) {
tmp = x + (y * ((z - t) / (a - t)));
} else if (y <= 5.328190999737839e-77) {
tmp = x + ((y * (z - t)) / (a - t));
} else {
tmp = x + (y / ((a - t) / (z - t)));
}
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.3 |
|---|---|
| Target | 0.4 |
| Herbie | 1.0 |
if y < -1.90329803177581204e79Initial program 0.7
if -1.90329803177581204e79 < y < 5.3281909997378391e-77Initial program 2.0
rmApplied associate-*r/_binary64_150241.3
if 5.3281909997378391e-77 < y Initial program 0.5
rmApplied clear-num_binary64_150810.6
rmApplied un-div-inv_binary64_150800.5
Final simplification1.0
herbie shell --seed 2020344
(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)))))