\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
t_1 \leq 0 \lor \neg \left(t_1 \leq 5.022756205473603 \cdot 10^{+222}\right)
\end{array}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t - z} - \frac{x \cdot z}{t - z}\\
\end{array}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t)
:precision binary64
(if (let* ((t_1 (/ (* x (- y z)) (- t z))))
(or (<= t_1 0.0) (not (<= t_1 5.022756205473603e+222))))
(* x (/ (- y z) (- t z)))
(- (/ (* x y) (- t z)) (/ (* x 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 <= 0.0) || !(t_1 <= 5.022756205473603e+222)) {
tmp = x * ((y - z) / (t - z));
} else {
tmp = ((x * y) / (t - z)) - ((x * z) / (t - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 11.7 |
|---|---|
| Target | 2.3 |
| Herbie | 1.5 |
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -0.0 or 5.02275620547360281e222 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 17.5
Applied *-un-lft-identity_binary6417.5
Applied times-frac_binary642.1
Simplified2.1
if -0.0 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 5.02275620547360281e222Initial program 0.3
Taylor expanded in y around 0 0.3
Final simplification1.5
herbie shell --seed 2021275
(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)))