\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:\\
\;\;\;\;\frac{x}{\frac{t - z}{y - z}}\\
\mathbf{elif}\;t_1 \leq 6.656739515096712 \cdot 10^{+236}:\\
\;\;\;\;\frac{x \cdot y - x \cdot z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{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 (/ (- t z) (- y z)))
(if (<= t_1 6.656739515096712e+236)
(/ (- (* x y) (* x z)) (- t z))
(* (- y z) (/ x (- 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 / ((t - z) / (y - z));
} else if (t_1 <= 6.656739515096712e+236) {
tmp = ((x * y) - (x * z)) / (t - z);
} else {
tmp = (y - z) * (x / (t - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 10.2 |
|---|---|
| Target | 2.1 |
| Herbie | 1.3 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -inf.0Initial program 38.9
Applied associate-/l*_binary640.1
if -inf.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 6.656739515096712e236Initial program 1.3
Applied *-un-lft-identity_binary641.3
Applied cancel-sign-sub-inv_binary641.3
Applied distribute-lft-in_binary641.3
if 6.656739515096712e236 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 35.6
Applied associate-/l*_binary641.1
Applied associate-/r/_binary642.2
Final simplification1.3
herbie shell --seed 2022088
(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)))