\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -5902353266861854707684716951842930556928 \lor \neg \left(x \le 5.84007380562484519005819080598235169684 \cdot 10^{83}\right):\\
\;\;\;\;x \cdot \left(\frac{1}{z} \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r208391 = x;
double r208392 = y;
double r208393 = z;
double r208394 = r208392 + r208393;
double r208395 = r208391 * r208394;
double r208396 = r208395 / r208393;
return r208396;
}
double f(double x, double y, double z) {
double r208397 = x;
double r208398 = -5.902353266861855e+39;
bool r208399 = r208397 <= r208398;
double r208400 = 5.840073805624845e+83;
bool r208401 = r208397 <= r208400;
double r208402 = !r208401;
bool r208403 = r208399 || r208402;
double r208404 = 1.0;
double r208405 = z;
double r208406 = r208404 / r208405;
double r208407 = y;
double r208408 = r208407 + r208405;
double r208409 = r208406 * r208408;
double r208410 = r208397 * r208409;
double r208411 = r208407 * r208397;
double r208412 = r208411 / r208405;
double r208413 = r208412 + r208397;
double r208414 = r208403 ? r208410 : r208413;
return r208414;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.7 |
|---|---|
| Target | 3.0 |
| Herbie | 2.0 |
if x < -5.902353266861855e+39 or 5.840073805624845e+83 < x Initial program 28.2
Simplified9.4
rmApplied associate-/r/0.1
rmApplied div-inv0.2
if -5.902353266861855e+39 < x < 5.840073805624845e+83Initial program 5.4
Simplified13.8
Taylor expanded around 0 2.9
Simplified2.6
rmApplied associate-*l/2.9
Simplified2.9
Final simplification2.0
herbie shell --seed 2019196
(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))