\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le 3.0872601480684541 \cdot 10^{-218} \lor \neg \left(x \le 1.24228458220251889 \cdot 10^{-142}\right):\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r513309 = x;
double r513310 = y;
double r513311 = z;
double r513312 = r513310 + r513311;
double r513313 = r513309 * r513312;
double r513314 = r513313 / r513311;
return r513314;
}
double f(double x, double y, double z) {
double r513315 = x;
double r513316 = 3.087260148068454e-218;
bool r513317 = r513315 <= r513316;
double r513318 = 1.2422845822025189e-142;
bool r513319 = r513315 <= r513318;
double r513320 = !r513319;
bool r513321 = r513317 || r513320;
double r513322 = y;
double r513323 = z;
double r513324 = r513322 + r513323;
double r513325 = r513324 / r513323;
double r513326 = r513315 * r513325;
double r513327 = r513315 * r513322;
double r513328 = 1.0;
double r513329 = r513328 / r513323;
double r513330 = r513327 * r513329;
double r513331 = r513330 + r513315;
double r513332 = r513321 ? r513326 : r513331;
return r513332;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 3.1 |
if x < 3.087260148068454e-218 or 1.2422845822025189e-142 < x Initial program 12.8
rmApplied *-un-lft-identity12.8
Applied times-frac3.1
Simplified3.1
if 3.087260148068454e-218 < x < 1.2422845822025189e-142Initial program 6.2
Taylor expanded around 0 3.7
rmApplied div-inv3.7
Final simplification3.1
herbie shell --seed 2020020
(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))