\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.3739507758416665 \cdot 10^{+251} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 7.074286107254158 \cdot 10^{+295}\right):\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{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 (<= (/ (* x (- y z)) (- t z)) -1.3739507758416665e+251)
(not (<= (/ (* x (- y z)) (- t z)) 7.074286107254158e+295)))
(* 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 tmp;
if ((((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= -1.3739507758416665e+251) || !((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 7.074286107254158e+295))) {
tmp = ((double) (x * (((double) (y - z)) / ((double) (t - z)))));
} else {
tmp = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.8 |
|---|---|
| Target | 2.1 |
| Herbie | 1.2 |
if (/ (* x (- y z)) (- t z)) < -1.37395077584166649e251 or 7.0742861072541579e295 < (/ (* x (- y z)) (- t z)) Initial program Error: 59.3 bits
SimplifiedError: 0.6 bits
if -1.37395077584166649e251 < (/ (* x (- y z)) (- t z)) < 7.0742861072541579e295Initial program Error: 1.3 bits
Final simplificationError: 1.2 bits
herbie shell --seed 2020203
(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)))