\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 r789886 = x;
double r789887 = y;
double r789888 = z;
double r789889 = r789887 - r789888;
double r789890 = r789886 * r789889;
double r789891 = r789890 / r789887;
return r789891;
}
double f(double x, double y, double z) {
double r789892 = x;
double r789893 = -4.727842335792455e-115;
bool r789894 = r789892 <= r789893;
double r789895 = y;
double r789896 = z;
double r789897 = r789895 - r789896;
double r789898 = r789897 / r789895;
double r789899 = r789892 * r789898;
double r789900 = 6.940297287083344e-305;
bool r789901 = r789892 <= r789900;
double r789902 = r789892 * r789896;
double r789903 = r789902 / r789895;
double r789904 = r789892 - r789903;
double r789905 = 1.0;
double r789906 = r789895 / r789897;
double r789907 = r789906 / r789892;
double r789908 = r789905 / r789907;
double r789909 = r789901 ? r789904 : r789908;
double r789910 = r789894 ? r789899 : r789909;
return r789910;
}




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))