\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -6.4546096464274241 \cdot 10^{-105} \lor \neg \left(x \le 1.476702020789425 \cdot 10^{-74}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, x, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{1}{z} + x\\
\end{array}double f(double x, double y, double z) {
double r441431 = x;
double r441432 = y;
double r441433 = z;
double r441434 = r441432 + r441433;
double r441435 = r441431 * r441434;
double r441436 = r441435 / r441433;
return r441436;
}
double f(double x, double y, double z) {
double r441437 = x;
double r441438 = -6.454609646427424e-105;
bool r441439 = r441437 <= r441438;
double r441440 = 1.4767020207894247e-74;
bool r441441 = r441437 <= r441440;
double r441442 = !r441441;
bool r441443 = r441439 || r441442;
double r441444 = y;
double r441445 = z;
double r441446 = r441444 / r441445;
double r441447 = fma(r441446, r441437, r441437);
double r441448 = r441444 * r441437;
double r441449 = 1.0;
double r441450 = r441449 / r441445;
double r441451 = r441448 * r441450;
double r441452 = r441451 + r441437;
double r441453 = r441443 ? r441447 : r441452;
return r441453;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.6 |
|---|---|
| Target | 3.3 |
| Herbie | 1.9 |
if x < -6.454609646427424e-105 or 1.4767020207894247e-74 < x Initial program 16.9
Simplified0.7
if -6.454609646427424e-105 < x < 1.4767020207894247e-74Initial program 6.7
Simplified7.4
rmApplied fma-udef7.4
rmApplied div-inv7.5
Applied associate-*l*3.4
Simplified3.4
rmApplied div-inv3.4
Applied associate-*r*3.6
Final simplification1.9
herbie shell --seed 2020064 +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))