\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.025060815940221284599523414245967851062 \cdot 10^{-116} \lor \neg \left(x \le 2.664793329374929939202329816063701600281 \cdot 10^{-65}\right):\\
\;\;\;\;\frac{y}{z} \cdot x + x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r407003 = x;
double r407004 = y;
double r407005 = z;
double r407006 = r407004 + r407005;
double r407007 = r407003 * r407006;
double r407008 = r407007 / r407005;
return r407008;
}
double f(double x, double y, double z) {
double r407009 = x;
double r407010 = -1.0250608159402213e-116;
bool r407011 = r407009 <= r407010;
double r407012 = 2.66479332937493e-65;
bool r407013 = r407009 <= r407012;
double r407014 = !r407013;
bool r407015 = r407011 || r407014;
double r407016 = y;
double r407017 = z;
double r407018 = r407016 / r407017;
double r407019 = r407018 * r407009;
double r407020 = r407019 + r407009;
double r407021 = r407009 * r407016;
double r407022 = 1.0;
double r407023 = r407022 / r407017;
double r407024 = r407021 * r407023;
double r407025 = r407024 + r407009;
double r407026 = r407015 ? r407020 : r407025;
return r407026;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.2 |
| Herbie | 2.0 |
if x < -1.0250608159402213e-116 or 2.66479332937493e-65 < x Initial program 17.0
Simplified0.7
rmApplied fma-udef0.7
if -1.0250608159402213e-116 < x < 2.66479332937493e-65Initial program 6.5
Simplified7.7
rmApplied fma-udef7.7
rmApplied *-un-lft-identity7.7
Applied add-cube-cbrt8.1
Applied times-frac8.1
Applied associate-*l*3.9
rmApplied associate-*l/3.4
rmApplied div-inv3.4
Applied associate-*r*4.3
Simplified3.9
Final simplification2.0
herbie shell --seed 2019353 +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))