\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -7.8753853100710241 \cdot 10^{73}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} + x\\
\mathbf{elif}\;z \le 1508501975980006900:\\
\;\;\;\;\frac{x \cdot y}{z} + x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r351082 = x;
double r351083 = y;
double r351084 = z;
double r351085 = r351083 + r351084;
double r351086 = r351082 * r351085;
double r351087 = r351086 / r351084;
return r351087;
}
double f(double x, double y, double z) {
double r351088 = z;
double r351089 = -7.875385310071024e+73;
bool r351090 = r351088 <= r351089;
double r351091 = x;
double r351092 = y;
double r351093 = r351088 / r351092;
double r351094 = r351091 / r351093;
double r351095 = r351094 + r351091;
double r351096 = 1.508501975980007e+18;
bool r351097 = r351088 <= r351096;
double r351098 = r351091 * r351092;
double r351099 = r351098 / r351088;
double r351100 = r351099 + r351091;
double r351101 = r351092 / r351088;
double r351102 = r351091 * r351101;
double r351103 = r351102 + r351091;
double r351104 = r351097 ? r351100 : r351103;
double r351105 = r351090 ? r351095 : r351104;
return r351105;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.0 |
|---|---|
| Target | 2.9 |
| Herbie | 1.7 |
if z < -7.875385310071024e+73Initial program 19.3
Simplified3.1
rmApplied fma-udef3.1
Simplified6.2
rmApplied associate-/l*0.0
if -7.875385310071024e+73 < z < 1.508501975980007e+18Initial program 6.1
Simplified7.2
rmApplied fma-udef7.2
Simplified3.3
rmApplied *-un-lft-identity3.3
Applied times-frac6.2
Simplified6.2
rmApplied associate-*r/3.3
if 1.508501975980007e+18 < z Initial program 17.0
Simplified2.9
rmApplied fma-udef2.9
Simplified5.8
rmApplied *-un-lft-identity5.8
Applied times-frac0.0
Simplified0.0
Final simplification1.7
herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))