x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} = -\infty:\\
\;\;\;\;\frac{z - t}{\frac{a - t}{y}} + x\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \le 6.8624750184523979 \cdot 10^{306}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\end{array}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 VAR;
if ((((y * (z - t)) / (a - t)) <= -inf.0)) {
VAR = (((z - t) / ((a - t) / y)) + x);
} else {
double VAR_1;
if ((((y * (z - t)) / (a - t)) <= 6.862475018452398e+306)) {
VAR_1 = (x + ((y * (z - t)) / (a - t)));
} else {
VAR_1 = fma((y / (a - t)), (z - t), x);
}
VAR = VAR_1;
}
return VAR;
}




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.3 |
| Herbie | 0.2 |
if (/ (* y (- z t)) (- a t)) < -inf.0Initial program 64.0
Simplified0.2
rmApplied clear-num0.3
rmApplied fma-udef0.3
Simplified0.2
if -inf.0 < (/ (* y (- z t)) (- a t)) < 6.862475018452398e+306Initial program 0.2
if 6.862475018452398e+306 < (/ (* y (- z t)) (- a t)) Initial program 63.8
Simplified0.2
Final simplification0.2
herbie shell --seed 2020091 +o rules:numerics
(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))))