\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;z \leq 6.744991936333286 \cdot 10^{-257}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{elif}\;z \leq 1.9845854779363898 \cdot 10^{+21}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\end{array}(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
:precision binary64
(if (<= z 6.744991936333286e-257)
(* x (/ (- y z) (- t z)))
(if (<= z 1.9845854779363898e+21)
(* (- y z) (/ x (- t z)))
(/ x (/ (- t z) (- y 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 <= 6.744991936333286e-257) {
tmp = x * ((y - z) / (t - z));
} else if (z <= 1.9845854779363898e+21) {
tmp = (y - z) * (x / (t - z));
} else {
tmp = x / ((t - z) / (y - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.2 |
|---|---|
| Target | 2.2 |
| Herbie | 2.3 |
if z < 6.7449919363332855e-257Initial program 11.2
rmApplied *-un-lft-identity_binary64_1576411.2
Applied times-frac_binary64_157702.5
if 6.7449919363332855e-257 < z < 1.9845854779363898e21Initial program 4.3
rmApplied associate-/l*_binary64_157093.6
rmApplied associate-/r/_binary64_157104.2
if 1.9845854779363898e21 < z Initial program 17.0
rmApplied associate-/l*_binary64_157090.1
Final simplification2.3
herbie shell --seed 2021093
(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)))