\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)\\
\mathbf{elif}\;t_1 \leq -2.77817195028 \cdot 10^{-312}:\\
\;\;\;\;t_1\\
\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
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 (- INFINITY))
(* x (* (- y z) (/ 1.0 (- t z))))
(if (<= t_1 -2.77817195028e-312) t_1 (* 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 t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x * ((y - z) * (1.0 / (t - z)));
} else if (t_1 <= -2.77817195028e-312) {
tmp = t_1;
} 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 | 12.0 |
|---|---|
| Target | 2.1 |
| Herbie | 1.3 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0Initial program 64.0
Applied *-un-lft-identity_binary6464.0
Applied times-frac_binary640.1
Simplified0.1
Applied div-inv_binary640.3
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -2.7781719502808e-312Initial program 0.3
Applied *-un-lft-identity_binary640.3
Applied times-frac_binary642.8
Simplified2.8
Taylor expanded in x around 0 0.3
if -2.7781719502808e-312 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 11.4
Applied *-un-lft-identity_binary6411.4
Applied times-frac_binary642.0
Simplified2.0
Final simplification1.3
herbie shell --seed 2022068
(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)))