\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 \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq -6.9544927341437 \cdot 10^{-318} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{t - z} \leq 0\right) \land \frac{x \cdot \left(y - z\right)}{t - z} \leq 2.751194885489083 \cdot 10^{-79}\right):\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{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)) (- INFINITY))
(not
(or (<= (/ (* x (- y z)) (- t z)) -6.9544927341437e-318)
(and (not (<= (/ (* x (- y z)) (- t z)) 0.0))
(<= (/ (* x (- y z)) (- t z)) 2.751194885489083e-79)))))
(* (- 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 ((((x * (y - z)) / (t - z)) <= -((double) INFINITY)) || !((((x * (y - z)) / (t - z)) <= -6.9544927341437e-318) || (!(((x * (y - z)) / (t - z)) <= 0.0) && (((x * (y - z)) / (t - z)) <= 2.751194885489083e-79)))) {
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.3 |
|---|---|
| Target | 2.1 |
| Herbie | 1.0 |
| Alternative 1 | |
|---|---|
| Error | 2.1 |
| Cost | 576 |
| Alternative 2 | |
|---|---|
| Error | 7.0 |
| Cost | 1860 |
| Alternative 3 | |
|---|---|
| Error | 16.0 |
| Cost | 1090 |
| Alternative 4 | |
|---|---|
| Error | 16.8 |
| Cost | 2374 |
| Alternative 5 | |
|---|---|
| Error | 16.7 |
| Cost | 1683 |
| Alternative 6 | |
|---|---|
| Error | 16.0 |
| Cost | 1041 |
| Alternative 7 | |
|---|---|
| Error | 21.0 |
| Cost | 1090 |
| Alternative 8 | |
|---|---|
| Error | 24.9 |
| Cost | 962 |
| Alternative 9 | |
|---|---|
| Error | 38.3 |
| Cost | 706 |
| Alternative 10 | |
|---|---|
| Error | 56.1 |
| Cost | 64 |
| Alternative 11 | |
|---|---|
| Error | 61.7 |
| Cost | 64 |

if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0 or -6.95449273e-318 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 0.0 or 2.7511948854890829e-79 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 23.9
rmApplied associate-/l*_binary64_167321.2
rmApplied associate-/r/_binary64_167331.7
Simplified1.7
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -6.95449273e-318 or 0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 2.7511948854890829e-79Initial program 0.3
Simplified0.3
Final simplification1.0
herbie shell --seed 2021044
(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)))