\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -\infty:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -4.699853111594 \cdot 10^{-316}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{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 (<= (/ (* x (- y z)) (- t z)) (- INFINITY))
(* (- y z) (/ x (- t z)))
(if (<= (/ (* x (- y z)) (- t z)) -4.699853111594e-316)
(/ (* x (- y z)) (- t z))
(/ x (/ (- t z) (- y 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))) <= ((double) -(((double) INFINITY))))) {
tmp = ((double) (((double) (y - z)) * (x / ((double) (t - z)))));
} else {
double tmp_1;
if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= -4.699853111594e-316)) {
tmp_1 = (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
} else {
tmp_1 = (x / (((double) (t - z)) / ((double) (y - z))));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.4 |
|---|---|
| Target | 2.4 |
| Herbie | 1.2 |
if (/ (* x (- y z)) (- t z)) < -inf.0Initial program Error: 64.0 bits
rmApplied associate-/l*Error: 0.1 bits
rmApplied associate-/r/Error: 0.2 bits
if -inf.0 < (/ (* x (- y z)) (- t z)) < -4.699853112e-316Initial program Error: 0.3 bits
if -4.699853112e-316 < (/ (* x (- y z)) (- t z)) Initial program Error: 10.6 bits
rmApplied associate-/l*Error: 2.0 bits
Final simplificationError: 1.2 bits
herbie shell --seed 2020205
(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)))