x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{1}{\frac{z - a}{z - t}}, x\right)\\
\mathbf{elif}\;t_1 \leq 9.359701849860649 \cdot 10^{+297}:\\
\;\;\;\;t_1 + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\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
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (<= t_1 (- INFINITY))
(fma y (/ 1.0 (/ (- z a) (- z t))) x)
(if (<= t_1 9.359701849860649e+297)
(+ t_1 x)
(fma y (/ (- z t) (- z a)) x)))))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 t_1 = (y * (z - t)) / (z - a);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(y, (1.0 / ((z - a) / (z - t))), x);
} else if (t_1 <= 9.359701849860649e+297) {
tmp = t_1 + x;
} else {
tmp = fma(y, ((z - t) / (z - a)), x);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 9.4 |
|---|---|
| Target | 1.1 |
| Herbie | 0.3 |
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0Initial program 38.5
Simplified0.1
Applied clear-num_binary640.1
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 9.35970184986064874e297Initial program 0.3
if 9.35970184986064874e297 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 38.1
Simplified0.1
Final simplification0.3
herbie shell --seed 2022068
(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))))