\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;z \leq -2.4822864824141573 \cdot 10^{-288} \lor \neg \left(z \leq 1.081099186151696 \cdot 10^{-51}\right):\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot x}{t - z}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.4822864824141573e-288) (not (<= z 1.081099186151696e-51))) (/ x (/ (- t z) (- y z))) (/ (- (* x y) (* z x)) (- t z))))
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 tmp;
if ((z <= -2.4822864824141573e-288) || !(z <= 1.081099186151696e-51)) {
tmp = x / ((t - z) / (y - z));
} else {
tmp = ((x * y) - (z * x)) / (t - z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.1 |
|---|---|
| Target | 2.1 |
| Herbie | 2.2 |
if z < -2.48228648241415734e-288 or 1.08109918615169594e-51 < z Initial program 12.7
rmApplied associate-/l*_binary641.3
if -2.48228648241415734e-288 < z < 1.08109918615169594e-51Initial program 5.4
rmApplied sub-neg_binary645.4
Applied distribute-rgt-in_binary645.4
Simplified5.4
Simplified5.4
Final simplification2.2
herbie shell --seed 2020253
(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)))