\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -4.198736726510580317627942676532283275075 \cdot 10^{73}:\\
\;\;\;\;x \cdot \frac{y + z}{z}\\
\mathbf{elif}\;x \le 4.322929192599831483537001033408001044383 \cdot 10^{-59}:\\
\;\;\;\;x + \frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y + z}{z}}{\frac{1}{x}}\\
\end{array}double f(double x, double y, double z) {
double r303228 = x;
double r303229 = y;
double r303230 = z;
double r303231 = r303229 + r303230;
double r303232 = r303228 * r303231;
double r303233 = r303232 / r303230;
return r303233;
}
double f(double x, double y, double z) {
double r303234 = x;
double r303235 = -4.1987367265105803e+73;
bool r303236 = r303234 <= r303235;
double r303237 = y;
double r303238 = z;
double r303239 = r303237 + r303238;
double r303240 = r303239 / r303238;
double r303241 = r303234 * r303240;
double r303242 = 4.3229291925998315e-59;
bool r303243 = r303234 <= r303242;
double r303244 = r303234 / r303238;
double r303245 = r303244 * r303237;
double r303246 = r303234 + r303245;
double r303247 = 1.0;
double r303248 = r303247 / r303234;
double r303249 = r303240 / r303248;
double r303250 = r303243 ? r303246 : r303249;
double r303251 = r303236 ? r303241 : r303250;
return r303251;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.1 |
|---|---|
| Target | 3.1 |
| Herbie | 1.8 |
if x < -4.1987367265105803e+73Initial program 28.4
Simplified8.6
rmApplied div-inv8.8
Applied associate-/r*0.2
rmApplied div-inv0.2
Simplified0.1
if -4.1987367265105803e+73 < x < 4.3229291925998315e-59Initial program 5.0
Simplified15.4
Taylor expanded around 0 2.6
Simplified2.8
if 4.3229291925998315e-59 < x Initial program 18.7
Simplified6.7
rmApplied div-inv6.8
Applied associate-/r*0.6
Final simplification1.8
herbie shell --seed 2019179
(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))