x + \frac{\left(y - z\right) \cdot t}{a - z}\begin{array}{l}
\mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} = -\infty \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 2.52318601275925725 \cdot 10^{284}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - z) * t) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double temp;
if ((((((y - z) * t) / (a - z)) <= -inf.0) || !((((y - z) * t) / (a - z)) <= 2.5231860127592572e+284))) {
temp = fma(((y - z) / (a - z)), t, x);
} else {
temp = (x + (((y - z) * t) / (a - z)));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 11.0 |
|---|---|
| Target | 0.6 |
| Herbie | 0.3 |
if (/ (* (- y z) t) (- a z)) < -inf.0 or 2.5231860127592572e+284 < (/ (* (- y z) t) (- a z)) Initial program 62.4
Simplified0.4
if -inf.0 < (/ (* (- y z) t) (- a z)) < 2.5231860127592572e+284Initial program 0.2
Final simplification0.3
herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))