\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \leq -3.6981446179524545 \cdot 10^{-179}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{elif}\;y \leq 8.01620173754629 \cdot 10^{-48}:\\
\;\;\;\;\left(x \cdot \left(y - z\right)\right) \cdot \frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z)
:precision binary64
(if (<= y -3.6981446179524545e-179)
(/ x (/ y (- y z)))
(if (<= y 8.01620173754629e-48)
(* (* x (- y z)) (/ 1.0 y))
(* x (/ (- y z) y)))))double code(double x, double y, double z) {
return (((double) (x * ((double) (y - z)))) / y);
}
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.6981446179524545e-179)) {
tmp = (x / (y / ((double) (y - z))));
} else {
double tmp_1;
if ((y <= 8.01620173754629e-48)) {
tmp_1 = ((double) (((double) (x * ((double) (y - z)))) * (1.0 / y)));
} else {
tmp_1 = ((double) (x * (((double) (y - z)) / y)));
}
tmp = tmp_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.9 |
|---|---|
| Target | 3.4 |
| Herbie | 2.8 |
if y < -3.6981446179524545e-179Initial program 13.5
rmApplied associate-/l*_binary641.2
if -3.6981446179524545e-179 < y < 8.01620173754628962e-48Initial program 8.6
rmApplied div-inv_binary648.8
if 8.01620173754628962e-48 < y Initial program 15.2
rmApplied *-un-lft-identity_binary6415.2
Applied times-frac_binary640.3
Simplified0.3
Final simplification2.8
herbie shell --seed 2020210
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
:precision binary64
:herbie-target
(if (< z -2.060202331921739e+104) (- x (/ (* z x) y)) (if (< z 1.6939766013828526e+213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))
(/ (* x (- y z)) y))