\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.1628805360148156 \cdot 10^{+110}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.0528411766114093 \cdot 10^{+233}:\\
\;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{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)) -1.1628805360148156e+110)
(* (- y z) (/ x (- t z)))
(if (<= (/ (* x (- y z)) (- t z)) 1.0528411766114093e+233)
(* (* x (- y z)) (/ 1.0 (- 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.1628805360148156e+110)) {
tmp = ((double) (((double) (y - z)) * (x / ((double) (t - z)))));
} else {
double tmp_1;
if (((((double) (x * ((double) (y - z)))) / ((double) (t - z))) <= 1.0528411766114093e+233)) {
tmp_1 = ((double) (((double) (x * ((double) (y - z)))) * (1.0 / ((double) (t - z)))));
} else {
tmp_1 = ((double) (x * (((double) (y - z)) / ((double) (t - 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.3 |
| Herbie | 2.0 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -1.1628805360148156e110Initial program 34.8
rmApplied associate-/l*_binary642.8
rmApplied associate-/r/_binary644.1
if -1.1628805360148156e110 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.0528411766114093e233Initial program 1.5
rmApplied div-inv_binary641.7
if 1.0528411766114093e233 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 51.6
rmApplied *-un-lft-identity_binary6451.6
Applied times-frac_binary641.6
Simplified1.6
Final simplification2.0
herbie shell --seed 2020210
(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)))