\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} = -\infty:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \le 5.316577800148401 \cdot 10^{177}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{t - z} - \frac{z}{t - z}\right)\\
\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 temp;
if ((((x * (y - z)) / (t - z)) <= -inf.0)) {
temp = ((x / (t - z)) * (y - z));
} else {
double temp_1;
if ((((x * (y - z)) / (t - z)) <= 5.316577800148401e+177)) {
temp_1 = ((x * (y - z)) / (t - z));
} else {
temp_1 = (x * ((y / (t - z)) - (z / (t - z))));
}
temp = temp_1;
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.5 |
|---|---|
| Target | 2.2 |
| Herbie | 1.5 |
if (/ (* x (- y z)) (- t z)) < -inf.0Initial program 64.0
rmApplied *-un-lft-identity64.0
Applied times-frac0.1
Simplified0.1
rmApplied div-sub0.1
rmApplied div-inv0.2
Applied div-inv0.2
Applied distribute-rgt-out--0.2
Applied associate-*r*0.4
Simplified0.2
if -inf.0 < (/ (* x (- y z)) (- t z)) < 5.316577800148401e+177Initial program 1.4
if 5.316577800148401e+177 < (/ (* x (- y z)) (- t z)) Initial program 43.7
rmApplied *-un-lft-identity43.7
Applied times-frac2.7
Simplified2.7
rmApplied div-sub2.7
Final simplification1.5
herbie shell --seed 2020056 +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)))