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:\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{z - a} \leq 4.560715426681786 \cdot 10^{+303}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{z - a} + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\
\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 (- z t)) (- z a)) (- INFINITY))
(+ x (* y (/ (- z t) (- z a))))
(if (<= (/ (* y (- z t)) (- z a)) 4.560715426681786e+303)
(+ (/ (* y (- z t)) (- z a)) x)
(+ x (/ y (/ (- z a) (- z t)))))))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)) {
tmp = x + (y * ((z - t) / (z - a)));
} else if (((y * (z - t)) / (z - a)) <= 4.560715426681786e+303) {
tmp = ((y * (z - t)) / (z - a)) + x;
} else {
tmp = x + (y / ((z - a) / (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 | 10.8 |
|---|---|
| Target | 1.2 |
| Herbie | 0.2 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity_binary6464.0
Applied times-frac_binary640.1
Simplified0.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 4.56071542668178609e303Initial program 0.2
if 4.56071542668178609e303 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 63.6
rmApplied associate-/l*_binary640.2
Final simplification0.2
herbie shell --seed 2020233
(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))))