\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot \left(y - z\right)}{y} = -\infty \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le -2.03190189492080534 \cdot 10^{98} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le 3.6608708735287544 \cdot 10^{-84} \lor \neg \left(\frac{x \cdot \left(y - z\right)}{y} \le 4.93193268925708101 \cdot 10^{238}\right)\right)\right):\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(y - z\right)}{y}\\
\end{array}double f(double x, double y, double z) {
double r761245 = x;
double r761246 = y;
double r761247 = z;
double r761248 = r761246 - r761247;
double r761249 = r761245 * r761248;
double r761250 = r761249 / r761246;
return r761250;
}
double f(double x, double y, double z) {
double r761251 = x;
double r761252 = y;
double r761253 = z;
double r761254 = r761252 - r761253;
double r761255 = r761251 * r761254;
double r761256 = r761255 / r761252;
double r761257 = -inf.0;
bool r761258 = r761256 <= r761257;
double r761259 = -2.0319018949208053e+98;
bool r761260 = r761256 <= r761259;
double r761261 = 3.6608708735287544e-84;
bool r761262 = r761256 <= r761261;
double r761263 = 4.931932689257081e+238;
bool r761264 = r761256 <= r761263;
double r761265 = !r761264;
bool r761266 = r761262 || r761265;
double r761267 = !r761266;
bool r761268 = r761260 || r761267;
double r761269 = !r761268;
bool r761270 = r761258 || r761269;
double r761271 = r761252 / r761254;
double r761272 = r761251 / r761271;
double r761273 = r761270 ? r761272 : r761256;
return r761273;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.4 |
| Herbie | 0.8 |
if (/ (* x (- y z)) y) < -inf.0 or -2.0319018949208053e+98 < (/ (* x (- y z)) y) < 3.6608708735287544e-84 or 4.931932689257081e+238 < (/ (* x (- y z)) y) Initial program 19.6
rmApplied associate-/l*1.1
if -inf.0 < (/ (* x (- y z)) y) < -2.0319018949208053e+98 or 3.6608708735287544e-84 < (/ (* x (- y z)) y) < 4.931932689257081e+238Initial program 0.3
Final simplification0.8
herbie shell --seed 2020024 +o rules:numerics
(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))