\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -105199849494522.6875 \lor \neg \left(z \le 4.243229654236487123021394252651212684572 \cdot 10^{84}\right):\\
\;\;\;\;\frac{y}{z} \cdot x + x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r501107 = x;
double r501108 = y;
double r501109 = z;
double r501110 = r501108 + r501109;
double r501111 = r501107 * r501110;
double r501112 = r501111 / r501109;
return r501112;
}
double f(double x, double y, double z) {
double r501113 = z;
double r501114 = -105199849494522.69;
bool r501115 = r501113 <= r501114;
double r501116 = 4.243229654236487e+84;
bool r501117 = r501113 <= r501116;
double r501118 = !r501117;
bool r501119 = r501115 || r501118;
double r501120 = y;
double r501121 = r501120 / r501113;
double r501122 = x;
double r501123 = r501121 * r501122;
double r501124 = r501123 + r501122;
double r501125 = r501122 * r501120;
double r501126 = r501125 / r501113;
double r501127 = r501126 + r501122;
double r501128 = r501119 ? r501124 : r501127;
return r501128;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.5 |
|---|---|
| Target | 3.0 |
| Herbie | 1.7 |
if z < -105199849494522.69 or 4.243229654236487e+84 < z Initial program 19.0
Simplified0.0
rmApplied fma-udef0.1
if -105199849494522.69 < z < 4.243229654236487e+84Initial program 6.4
Simplified6.4
rmApplied fma-udef6.4
rmApplied add-cube-cbrt7.0
Applied *-un-lft-identity7.0
Applied times-frac7.0
Applied associate-*l*3.3
Taylor expanded around 0 3.3
Final simplification1.7
herbie shell --seed 2019362 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))