\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 -7.365184855426764 \cdot 10^{+212}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{t - z}\\
\mathbf{elif}\;t_1 \leq 1.892476301148154 \cdot 10^{+261}:\\
\;\;\;\;\frac{x \cdot y}{t - z} - \frac{x \cdot z}{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
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 -7.365184855426764e+212)
(* (- y z) (/ x (- t z)))
(if (<= t_1 1.892476301148154e+261)
(- (/ (* x y) (- t z)) (/ (* x 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 t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= -7.365184855426764e+212) {
tmp = (y - z) * (x / (t - z));
} else if (t_1 <= 1.892476301148154e+261) {
tmp = ((x * y) / (t - z)) - ((x * 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.6 |
|---|---|
| Target | 1.9 |
| Herbie | 1.5 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -7.3651848554267645e212Initial program 48.7
Applied associate-/l*_binary641.4
Applied div-inv_binary641.5
Applied associate-/r*_binary644.2
Applied associate-/r/_binary644.1
if -7.3651848554267645e212 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 1.892476301148154e261Initial program 1.3
Taylor expanded in y around 0 1.3
if 1.892476301148154e261 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 58.3
Applied associate-/l*_binary641.0
Final simplification1.5
herbie shell --seed 2021280
(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)))