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




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.5 |
|---|---|
| Target | 2.0 |
| Herbie | 2.0 |
if z < -3.25369e-177Initial program 12.9
rmApplied associate-/l*_binary64_25641.2
if -3.25369e-177 < z < 1.18792e-141Initial program 5.9
rmApplied associate-/l*_binary64_25645.5
rmApplied associate-/r/_binary64_25655.4
if 1.18792e-141 < z Initial program 13.2
rmApplied *-un-lft-identity_binary64_250013.2
Applied *-un-lft-identity_binary64_250013.2
Applied distribute-lft-out--_binary64_254513.2
Applied times-frac_binary64_24950.9
Simplified0.9
Final simplification2.0
herbie shell --seed 2020231
(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)))