\frac{x \cdot \left(y - z\right)}{y}\begin{array}{l}
\mathbf{if}\;x \le 1.3817440569525898 \cdot 10^{-289}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\mathbf{elif}\;x \le 4.0099369996684946 \cdot 10^{-103}:\\
\;\;\;\;x - \frac{z \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y - z}{y}\\
\end{array}double f(double x, double y, double z) {
double r40823394 = x;
double r40823395 = y;
double r40823396 = z;
double r40823397 = r40823395 - r40823396;
double r40823398 = r40823394 * r40823397;
double r40823399 = r40823398 / r40823395;
return r40823399;
}
double f(double x, double y, double z) {
double r40823400 = x;
double r40823401 = 1.3817440569525898e-289;
bool r40823402 = r40823400 <= r40823401;
double r40823403 = y;
double r40823404 = z;
double r40823405 = r40823403 - r40823404;
double r40823406 = r40823405 / r40823403;
double r40823407 = r40823400 * r40823406;
double r40823408 = 4.0099369996684946e-103;
bool r40823409 = r40823400 <= r40823408;
double r40823410 = r40823404 * r40823400;
double r40823411 = r40823410 / r40823403;
double r40823412 = r40823400 - r40823411;
double r40823413 = r40823409 ? r40823412 : r40823407;
double r40823414 = r40823402 ? r40823407 : r40823413;
return r40823414;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.3 |
|---|---|
| Target | 2.8 |
| Herbie | 2.6 |
if x < 1.3817440569525898e-289 or 4.0099369996684946e-103 < x Initial program 13.5
rmApplied *-un-lft-identity13.5
Applied times-frac2.4
Simplified2.4
if 1.3817440569525898e-289 < x < 4.0099369996684946e-103Initial program 6.2
rmApplied *-un-lft-identity6.2
Applied times-frac6.5
Simplified6.5
Taylor expanded around 0 3.4
Final simplification2.6
herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z)
:name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
: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))