\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.503045921817015 \cdot 10^{-229}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.503823389807409 \cdot 10^{+304}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\end{array}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))) <= 1.503045921817015e-229)) {
VAR = ((double) (x * (((double) (y - z)) / ((double) (t - z)))));
} else {
double VAR_1;
if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 1.503823389807409e+304)) {
VAR_1 = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
} else {
VAR_1 = (x / (((double) (t - z)) / ((double) (y - 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 | 2.1 |
| Herbie | 1.3 |
if (/ (* x (- y z)) (- t z)) < 1.5030459218170149e-229Initial program 10.6
Simplified2.0
if 1.5030459218170149e-229 < (/ (* x (- y z)) (- t z)) < 1.5038233898074091e304Initial program 0.3
if 1.5038233898074091e304 < (/ (* x (- y z)) (- t z)) Initial program 63.7
Simplified0.2
rmApplied clear-num0.2
rmApplied un-div-inv0.2
Final simplification1.3
herbie shell --seed 2020199
(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)))