\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq -9.693178357350792 \cdot 10^{+194}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{elif}\;\frac{x \cdot \left(y - z\right)}{t - z} \leq 1.6781988869850722 \cdot 10^{+238}:\\
\;\;\;\;\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)) -9.693178357350792e+194)
(* x (/ (- y z) (- t z)))
(if (<= (/ (* x (- y z)) (- t z)) 1.6781988869850722e+238)
(/ (* x (- y z)) (- t z))
(/ x (/ (- t z) (- y 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)) <= -9.693178357350792e+194) {
tmp = x * ((y - z) / (t - z));
} else if (((x * (y - z)) / (t - z)) <= 1.6781988869850722e+238) {
tmp = (x * (y - z)) / (t - z);
} else {
tmp = x / ((t - z) / (y - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.5 |
|---|---|
| Target | 2.2 |
| Herbie | 1.4 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -9.69317835735079163e194Initial program 46.3
Simplified2.2
if -9.69317835735079163e194 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.67819888698507223e238Initial program 1.3
if 1.67819888698507223e238 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 53.3
Simplified1.1
Final simplification1.4
herbie shell --seed 2021176
(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)))