x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \leq -8.181875273801221 \cdot 10^{+64} \lor \neg \left(y \leq 3.208986056831293 \cdot 10^{-122}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)\\
\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 -8.181875273801221e+64) (not (<= y 3.208986056831293e-122))) (fma y (/ (- z t) (- a t)) x) (+ x (/ (* y (- z t)) (- a 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 <= -8.181875273801221e+64) || !(y <= 3.208986056831293e-122)) {
tmp = fma(y, ((z - t) / (a - t)), x);
} else {
tmp = x + ((y * (z - t)) / (a - t));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
| Original | 10.4 |
|---|---|
| Target | 1.3 |
| Herbie | 0.9 |
if y < -8.1818752738012213e64 or 3.208986056831293e-122 < y Initial program 19.4
Simplified0.8
if -8.1818752738012213e64 < y < 3.208986056831293e-122Initial program 0.9
Final simplification0.9
herbie shell --seed 2022068
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))