\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;x \le -4.727842335792455 \cdot 10^{-115}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;x \le 6.94029728708334437 \cdot 10^{-305}:\\
\;\;\;\;x - \frac{x \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\frac{y}{y - z}}{x}}\\
\end{array}double f(double x, double y, double z) {
double r908508 = x;
double r908509 = y;
double r908510 = z;
double r908511 = r908509 - r908510;
double r908512 = r908508 * r908511;
double r908513 = r908512 / r908509;
return r908513;
}
double f(double x, double y, double z) {
double r908514 = x;
double r908515 = -4.727842335792455e-115;
bool r908516 = r908514 <= r908515;
double r908517 = y;
double r908518 = z;
double r908519 = r908517 - r908518;
double r908520 = r908519 / r908517;
double r908521 = r908514 * r908520;
double r908522 = 6.940297287083344e-305;
bool r908523 = r908514 <= r908522;
double r908524 = r908514 * r908518;
double r908525 = r908524 / r908517;
double r908526 = r908514 - r908525;
double r908527 = 1.0;
double r908528 = r908517 / r908519;
double r908529 = r908528 / r908514;
double r908530 = r908527 / r908529;
double r908531 = r908523 ? r908526 : r908530;
double r908532 = r908516 ? r908521 : r908531;
return r908532;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.0 |
|---|---|
| Target | 3.3 |
| Herbie | 2.6 |
if x < -4.727842335792455e-115Initial program 14.6
rmApplied *-un-lft-identity14.6
Applied times-frac0.9
Simplified0.9
if -4.727842335792455e-115 < x < 6.940297287083344e-305Initial program 7.2
rmApplied associate-/l*7.3
Taylor expanded around 0 4.0
if 6.940297287083344e-305 < x Initial program 12.1
rmApplied associate-/l*3.0
rmApplied div-inv3.2
rmApplied clear-num3.2
Simplified3.2
Final simplification2.6
herbie shell --seed 2020046 +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))