x + \frac{y \cdot \left(z - t\right)}{z - a}\begin{array}{l}
\mathbf{if}\;z \le -9.99905195886523696 \cdot 10^{-146} \lor \neg \left(z \le 2.6902497134281926 \cdot 10^{-142}\right):\\
\;\;\;\;\frac{z - t}{z - a} \cdot y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)\\
\end{array}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 VAR;
if (((z <= -9.999051958865237e-146) || !(z <= 2.6902497134281926e-142))) {
VAR = ((((z - t) / (z - a)) * y) + x);
} else {
VAR = fma((y / (z - a)), (z - t), x);
}
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.4 |
|---|---|
| Target | 1.2 |
| Herbie | 1.3 |
if z < -9.999051958865237e-146 or 2.6902497134281926e-142 < z Initial program 12.7
Simplified2.8
rmApplied clear-num3.1
rmApplied fma-udef3.1
Simplified2.9
rmApplied associate-/r/0.5
if -9.999051958865237e-146 < z < 2.6902497134281926e-142Initial program 3.3
Simplified3.9
Final simplification1.3
herbie shell --seed 2020105 +o rules:numerics
(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))))