\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.033791867065685906604667525203590533578 \cdot 10^{-67}\right):\\
\;\;\;\;x \cdot \frac{y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r432750 = x;
double r432751 = y;
double r432752 = z;
double r432753 = r432751 + r432752;
double r432754 = r432750 * r432753;
double r432755 = r432754 / r432752;
return r432755;
}
double f(double x, double y, double z) {
double r432756 = x;
double r432757 = -1.0250608159402213e-116;
bool r432758 = r432756 <= r432757;
double r432759 = 2.033791867065686e-67;
bool r432760 = r432756 <= r432759;
double r432761 = !r432760;
bool r432762 = r432758 || r432761;
double r432763 = y;
double r432764 = z;
double r432765 = r432763 / r432764;
double r432766 = r432756 * r432765;
double r432767 = r432766 + r432756;
double r432768 = r432756 * r432763;
double r432769 = r432768 / r432764;
double r432770 = r432769 + r432756;
double r432771 = r432762 ? r432767 : r432770;
return r432771;
}




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.033791867065686e-67 < x Initial program 16.9
Taylor expanded around 0 5.9
rmApplied *-un-lft-identity5.9
Applied times-frac0.7
Simplified0.7
if -1.0250608159402213e-116 < x < 2.033791867065686e-67Initial program 6.5
Taylor expanded around 0 3.9
Final simplification2.0
herbie shell --seed 2019353
(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))