\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;y \leq -4.703315838445289 \cdot 10^{-269}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;y \leq 2.8551718262738205 \cdot 10^{-60}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x (- y z)) y))
(FPCore (x y z) :precision binary64 (if (<= y -4.703315838445289e-269) (* x (/ (- y z) y)) (if (<= y 2.8551718262738205e-60) (* (- y z) (/ x y)) (/ x (/ y (- y z))))))
double code(double x, double y, double z) {
return (x * (y - z)) / y;
}
double code(double x, double y, double z) {
double tmp;
if (y <= -4.703315838445289e-269) {
tmp = x * ((y - z) / y);
} else if (y <= 2.8551718262738205e-60) {
tmp = (y - z) * (x / y);
} else {
tmp = x / (y / (y - z));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.2 |
| Herbie | 3.2 |
if y < -4.7033158384452891e-269Initial program 12.4
rmApplied *-un-lft-identity_binary6412.4
Applied times-frac_binary642.8
Simplified2.8
if -4.7033158384452891e-269 < y < 2.85517182627382053e-60Initial program 8.6
rmApplied associate-/l*_binary6410.1
rmApplied associate-/r/_binary649.7
if 2.85517182627382053e-60 < y Initial program 14.7
rmApplied associate-/l*_binary640.3
Final simplification3.2
herbie shell --seed 2020219
(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))