\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
t_1 := x \cdot \frac{y - z}{t - z}\\
\mathbf{if}\;z \leq -1.9332557615753545 \cdot 10^{-212}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.0967477663018776 \cdot 10^{-139}:\\
\;\;\;\;\frac{y - z}{\left(t - z\right) \cdot \frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\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 (<= z -1.9332557615753545e-212)
t_1
(if (<= z 6.0967477663018776e-139)
(/ (- y z) (* (- t z) (/ 1.0 x)))
t_1))))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 (z <= -1.9332557615753545e-212) {
tmp = t_1;
} else if (z <= 6.0967477663018776e-139) {
tmp = (y - z) / ((t - z) * (1.0 / x));
} else {
tmp = t_1;
}
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 | 2.1 |
if z < -1.9332557615753545e-212 or 6.09674776630187758e-139 < z Initial program 12.5
Applied egg-rr1.2
if -1.9332557615753545e-212 < z < 6.09674776630187758e-139Initial program 6.3
Applied egg-rr5.6
Applied egg-rr5.5
Final simplification2.1
herbie shell --seed 2022130
(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)))