\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;z \le -3.3996600186244516 \cdot 10^{-112}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{elif}\;z \le -2.1071166133089801 \cdot 10^{-274}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\end{array}double code(double x, double y, double z, double t) {
return ((x * (y - z)) / (t - z));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((z <= -3.3996600186244516e-112)) {
VAR = (x * ((y - z) / (t - z)));
} else {
double VAR_1;
if ((z <= -2.10711661330898e-274)) {
VAR_1 = ((x * (y - z)) / (t - z));
} else {
VAR_1 = (x / ((t - z) / (y - z)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.8 |
|---|---|
| Target | 2.2 |
| Herbie | 2.2 |
if z < -3.3996600186244516e-112Initial program 14.5
rmApplied associate-/l*0.8
rmApplied div-inv0.9
Simplified0.8
if -3.3996600186244516e-112 < z < -2.10711661330898e-274Initial program 5.8
if -2.10711661330898e-274 < z Initial program 11.3
rmApplied associate-/l*2.3
Final simplification2.2
herbie shell --seed 2020071 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
:herbie-target
(/ x (/ (- t z) (- y z)))
(/ (* x (- y z)) (- t z)))