\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -1.255846650745649725506181831891083788832 \cdot 10^{-5} \lor \neg \left(x \le 1.503173573058023886830252677962462100403 \cdot 10^{-55}\right):\\
\;\;\;\;\mathsf{fma}\left(x, \frac{y}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r230667 = x;
double r230668 = y;
double r230669 = z;
double r230670 = r230668 + r230669;
double r230671 = r230667 * r230670;
double r230672 = r230671 / r230669;
return r230672;
}
double f(double x, double y, double z) {
double r230673 = x;
double r230674 = -1.2558466507456497e-05;
bool r230675 = r230673 <= r230674;
double r230676 = 1.5031735730580239e-55;
bool r230677 = r230673 <= r230676;
double r230678 = !r230677;
bool r230679 = r230675 || r230678;
double r230680 = y;
double r230681 = z;
double r230682 = r230680 / r230681;
double r230683 = fma(r230673, r230682, r230673);
double r230684 = r230673 * r230680;
double r230685 = r230684 / r230681;
double r230686 = r230685 + r230673;
double r230687 = r230679 ? r230683 : r230686;
return r230687;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.3 |
|---|---|
| Target | 3.1 |
| Herbie | 1.6 |
if x < -1.2558466507456497e-05 or 1.5031735730580239e-55 < x Initial program 19.5
Simplified6.5
rmApplied fma-udef6.5
Simplified6.5
rmApplied *-un-lft-identity6.5
rmApplied *-un-lft-identity6.5
Applied times-frac0.3
Applied fma-def0.3
if -1.2558466507456497e-05 < x < 1.5031735730580239e-55Initial program 5.7
Simplified2.6
rmApplied fma-udef2.6
Simplified2.9
rmApplied *-un-lft-identity2.9
Final simplification1.6
herbie shell --seed 2019212 +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))