\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;x \le -5.003280054887692628318180433391057882342 \cdot 10^{-101}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;x \le 5.758281187392745987255992146907159625285 \cdot 10^{-300}:\\
\;\;\;\;\frac{1}{y} \cdot \left(x \cdot \left(y - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\
\end{array}double f(double x, double y, double z) {
double r873397 = x;
double r873398 = y;
double r873399 = z;
double r873400 = r873398 - r873399;
double r873401 = r873397 * r873400;
double r873402 = r873401 / r873398;
return r873402;
}
double f(double x, double y, double z) {
double r873403 = x;
double r873404 = -5.0032800548876926e-101;
bool r873405 = r873403 <= r873404;
double r873406 = y;
double r873407 = z;
double r873408 = r873406 - r873407;
double r873409 = r873408 / r873406;
double r873410 = r873403 * r873409;
double r873411 = 5.758281187392746e-300;
bool r873412 = r873403 <= r873411;
double r873413 = 1.0;
double r873414 = r873413 / r873406;
double r873415 = r873403 * r873408;
double r873416 = r873414 * r873415;
double r873417 = r873406 / r873408;
double r873418 = r873403 / r873417;
double r873419 = r873412 ? r873416 : r873418;
double r873420 = r873405 ? r873410 : r873419;
return r873420;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.1 |
|---|---|
| Target | 2.9 |
| Herbie | 3.1 |
if x < -5.0032800548876926e-101Initial program 15.2
rmApplied *-un-lft-identity15.2
Applied times-frac0.7
Simplified0.7
if -5.0032800548876926e-101 < x < 5.758281187392746e-300Initial program 7.4
rmApplied associate-/l*5.7
rmApplied div-inv5.8
Applied *-un-lft-identity5.8
Applied times-frac7.4
Simplified7.5
if 5.758281187392746e-300 < x Initial program 12.2
rmApplied associate-/l*2.6
Final simplification3.1
herbie shell --seed 2019362 +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))