x + y \cdot \frac{z - t}{a - t}\begin{array}{l}
\mathbf{if}\;y \leq -5.438913823975979 \cdot 10^{-21} \lor \neg \left(y \leq 6.819889407613578 \cdot 10^{-60}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - 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 (or (<= y -5.438913823975979e-21) (not (<= y 6.819889407613578e-60))) (+ x (/ y (/ (- a t) (- z t)))) (+ x (/ (* y (- z t)) (- a t)))))
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 tmp;
if (((y <= -5.438913823975979e-21) || !(y <= 6.819889407613578e-60))) {
tmp = ((double) (x + (y / (((double) (a - t)) / ((double) (z - t))))));
} else {
tmp = ((double) (x + (((double) (y * ((double) (z - t)))) / ((double) (a - 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.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -5.43891382397597878e-21 or 6.81988940761357775e-60 < y Initial program Error: 0.5 bits
rmApplied associate-*r/Error: 19.9 bits
rmApplied associate-/l*Error: 0.5 bits
if -5.43891382397597878e-21 < y < 6.81988940761357775e-60Initial program Error: 2.3 bits
rmApplied associate-*r/Error: 0.2 bits
Final simplificationError: 0.4 bits
herbie shell --seed 2020203
(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)))))