x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq -\infty \lor \neg \left(\frac{y \cdot \left(z - t\right)}{z - a} \leq 4.01350158765124 \cdot 10^{+221}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z - y \cdot t}{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 (- z t)) (- z a)) (- INFINITY))
(not (<= (/ (* y (- z t)) (- z a)) 4.01350158765124e+221)))
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (- (* y z) (* y 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 * (z - t)) / (z - a)) <= -((double) INFINITY)) || !(((y * (z - t)) / (z - a)) <= 4.01350158765124e+221)) {
tmp = x + (y / ((z - a) / (z - t)));
} else {
tmp = x + (((y * z) - (y * 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 | 10.7 |
|---|---|
| Target | 1.2 |
| Herbie | 0.4 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 4.01350158765124013e221 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 56.0
rmApplied associate-/l*_binary64_143451.3
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.01350158765124013e221Initial program 0.2
rmApplied sub-neg_binary64_143930.2
Applied distribute-rgt-in_binary64_143500.2
Simplified0.2
Simplified0.2
Final simplification0.4
herbie shell --seed 2020355
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))