\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -2.458030110290383629327789829095143522841 \cdot 10^{-10} \lor \neg \left(x \le -1.241099098232442995043783878232537440558 \cdot 10^{-297}\right):\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}double f(double x, double y, double z) {
double r501471 = x;
double r501472 = y;
double r501473 = z;
double r501474 = r501472 + r501473;
double r501475 = r501471 * r501474;
double r501476 = r501475 / r501473;
return r501476;
}
double f(double x, double y, double z) {
double r501477 = x;
double r501478 = -2.4580301102903836e-10;
bool r501479 = r501477 <= r501478;
double r501480 = -1.241099098232443e-297;
bool r501481 = r501477 <= r501480;
double r501482 = !r501481;
bool r501483 = r501479 || r501482;
double r501484 = y;
double r501485 = z;
double r501486 = r501484 + r501485;
double r501487 = r501486 / r501485;
double r501488 = r501477 * r501487;
double r501489 = 1.0;
double r501490 = r501489 / r501485;
double r501491 = r501477 * r501486;
double r501492 = r501490 * r501491;
double r501493 = r501483 ? r501488 : r501492;
return r501493;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.4 |
|---|---|
| Target | 3.1 |
| Herbie | 3.2 |
if x < -2.4580301102903836e-10 or -1.241099098232443e-297 < x Initial program 15.2
rmApplied *-un-lft-identity15.2
Applied times-frac2.5
Simplified2.5
if -2.4580301102903836e-10 < x < -1.241099098232443e-297Initial program 5.0
rmApplied associate-/l*5.3
rmApplied div-inv5.4
Applied *-un-lft-identity5.4
Applied times-frac5.1
Simplified5.1
Final simplification3.2
herbie shell --seed 2019354
(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))