\frac{x \cdot \left(y - z\right)}{t - z}
\begin{array}{l}
\mathbf{if}\;x \leq -2.464627712927991 \cdot 10^{-49}:\\
\;\;\;\;\frac{x}{t - z} \cdot \left(y - z\right)\\
\mathbf{elif}\;x \leq -9.604018982582673 \cdot 10^{-297}:\\
\;\;\;\;\frac{x \cdot y}{t - z} - \frac{x \cdot z}{t - z}\\
\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
(if (<= x -2.464627712927991e-49)
(* (/ x (- t z)) (- y z))
(if (<= x -9.604018982582673e-297)
(- (/ (* x y) (- t z)) (/ (* x z) (- t z)))
(* 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 tmp;
if (x <= -2.464627712927991e-49) {
tmp = (x / (t - z)) * (y - z);
} else if (x <= -9.604018982582673e-297) {
tmp = ((x * y) / (t - z)) - ((x * z) / (t - z));
} 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 | 11.5 |
|---|---|
| Target | 2.0 |
| Herbie | 2.1 |
if x < -2.46462771292799119e-49Initial program 19.6
Applied associate-/l*_binary642.0
Applied associate-/r/_binary642.6
if -2.46462771292799119e-49 < x < -9.6040189825826731e-297Initial program 1.8
Taylor expanded in y around 0 1.8
if -9.6040189825826731e-297 < x Initial program 11.2
Applied *-un-lft-identity_binary6411.2
Applied times-frac_binary642.0
Simplified2.0
Final simplification2.1
herbie shell --seed 2021313
(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)))