\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -3224881.21410087356:\\
\;\;\;\;x \cdot \frac{y}{z} + x\\
\mathbf{elif}\;x \le 6.52312952635915906 \cdot 10^{-73}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y + z}}\\
\end{array}double f(double x, double y, double z) {
double r527655 = x;
double r527656 = y;
double r527657 = z;
double r527658 = r527656 + r527657;
double r527659 = r527655 * r527658;
double r527660 = r527659 / r527657;
return r527660;
}
double f(double x, double y, double z) {
double r527661 = x;
double r527662 = -3224881.2141008736;
bool r527663 = r527661 <= r527662;
double r527664 = y;
double r527665 = z;
double r527666 = r527664 / r527665;
double r527667 = r527661 * r527666;
double r527668 = r527667 + r527661;
double r527669 = 6.523129526359159e-73;
bool r527670 = r527661 <= r527669;
double r527671 = r527661 * r527664;
double r527672 = r527671 / r527665;
double r527673 = r527672 + r527661;
double r527674 = r527664 + r527665;
double r527675 = r527665 / r527674;
double r527676 = r527661 / r527675;
double r527677 = r527670 ? r527673 : r527676;
double r527678 = r527663 ? r527668 : r527677;
return r527678;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.0 |
|---|---|
| Target | 3.0 |
| Herbie | 1.5 |
if x < -3224881.2141008736Initial program 22.7
rmApplied associate-/l*0.1
Taylor expanded around 0 7.6
rmApplied *-un-lft-identity7.6
Applied times-frac0.1
Simplified0.1
if -3224881.2141008736 < x < 6.523129526359159e-73Initial program 5.2
rmApplied associate-/l*5.5
Taylor expanded around 0 2.6
if 6.523129526359159e-73 < x Initial program 16.8
rmApplied associate-/l*0.5
Final simplification1.5
herbie shell --seed 2020057
(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))