\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.653007623578952 \cdot 10^{102}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, x, x\right)\\
\end{array}double f(double x, double y, double z) {
double r432027 = x;
double r432028 = y;
double r432029 = z;
double r432030 = r432028 + r432029;
double r432031 = r432027 * r432030;
double r432032 = r432031 / r432029;
return r432032;
}
double f(double x, double y, double z) {
double r432033 = y;
double r432034 = -1.653007623578952e+102;
bool r432035 = r432033 <= r432034;
double r432036 = x;
double r432037 = z;
double r432038 = r432036 / r432037;
double r432039 = fma(r432033, r432038, r432036);
double r432040 = r432033 / r432037;
double r432041 = fma(r432040, r432036, r432036);
double r432042 = r432035 ? r432039 : r432041;
return r432042;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.6 |
|---|---|
| Target | 3.0 |
| Herbie | 2.6 |
if y < -1.653007623578952e+102Initial program 11.5
Simplified11.1
rmApplied fma-udef11.1
rmApplied div-inv11.2
Applied associate-*l*5.7
Simplified5.7
rmApplied fma-def5.7
if -1.653007623578952e+102 < y Initial program 12.8
Simplified2.1
Final simplification2.6
herbie shell --seed 2020018 +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))