\frac{x \cdot \left(y - z\right)}{t - z}\begin{array}{l}
\mathbf{if}\;x \leq -4.9940661561368986 \cdot 10^{+17}:\\
\;\;\;\;x \cdot \frac{y - z}{t - z}\\
\mathbf{elif}\;x \leq 3.185382957686135 \cdot 10^{-242}:\\
\;\;\;\;\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
(if (<= x -4.9940661561368986e+17)
(* x (/ (- y z) (- t z)))
(if (<= x 3.185382957686135e-242)
(- (/ (* 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 tmp;
if (x <= -4.9940661561368986e+17) {
tmp = x * ((y - z) / (t - z));
} else if (x <= 3.185382957686135e-242) {
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.7 |
|---|---|
| Target | 2.1 |
| Herbie | 2.1 |
if x < -499406615613689900Initial program 25.0
rmApplied *-un-lft-identity_binary6425.0
Applied times-frac_binary642.6
if -499406615613689900 < x < 3.1853829576861352e-242Initial program 2.1
Taylor expanded around 0 2.1
if 3.1853829576861352e-242 < x Initial program 12.6
rmApplied associate-/l*_binary641.9
Final simplification2.1
herbie shell --seed 2021174
(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)))