\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 5.926124174923842 \cdot 10^{-301}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 2.1377918219095245 \cdot 10^{+256}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{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 (<= (/ (* x (- y z)) (- t z)) 5.926124174923842e-301)
(/ x (/ (- t z) (- y z)))
(if (<= (/ (* x (- y z)) (- t z)) 2.1377918219095245e+256)
(/ (* x (- y z)) (- t z))
(* x (/ (- y z) (- t z))))))double code(double x, double y, double z, double t) {
return (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 5.926124174923842e-301)) {
VAR = (x / (((double) (t - z)) / ((double) (y - z))));
} else {
double VAR_1;
if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 2.1377918219095245e+256)) {
VAR_1 = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
} else {
VAR_1 = ((double) (x * (((double) (y - z)) / ((double) (t - z)))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 12.0 |
|---|---|
| Target | 1.9 |
| Herbie | 1.2 |
if (/ (* x (- y z)) (- t z)) < 5.9261241749238418e-301Initial program 11.6
Simplified1.8
rmApplied clear-num1.9
rmApplied un-div-inv1.7
if 5.9261241749238418e-301 < (/ (* x (- y z)) (- t z)) < 2.1377918219095245e256Initial program 0.3
if 2.1377918219095245e256 < (/ (* x (- y z)) (- t z)) Initial program 56.2
Simplified1.3
Final simplification1.2
herbie shell --seed 2020198
(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)))