\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -7.491778140344410199247807476987183548672 \cdot 10^{-177}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, x, x\right)\\
\mathbf{elif}\;z \le 7.318632377525780595545793146364737579954 \cdot 10^{-214}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{z}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}} + x\\
\end{array}double f(double x, double y, double z) {
double r290255 = x;
double r290256 = y;
double r290257 = z;
double r290258 = r290256 + r290257;
double r290259 = r290255 * r290258;
double r290260 = r290259 / r290257;
return r290260;
}
double f(double x, double y, double z) {
double r290261 = z;
double r290262 = -7.49177814034441e-177;
bool r290263 = r290261 <= r290262;
double r290264 = y;
double r290265 = r290264 / r290261;
double r290266 = x;
double r290267 = fma(r290265, r290266, r290266);
double r290268 = 7.318632377525781e-214;
bool r290269 = r290261 <= r290268;
double r290270 = r290266 / r290261;
double r290271 = fma(r290270, r290264, r290266);
double r290272 = r290261 / r290264;
double r290273 = r290266 / r290272;
double r290274 = r290273 + r290266;
double r290275 = r290269 ? r290271 : r290274;
double r290276 = r290263 ? r290267 : r290275;
return r290276;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.4 |
|---|---|
| Target | 3.0 |
| Herbie | 3.1 |
if z < -7.49177814034441e-177Initial program 12.3
Simplified1.6
if -7.49177814034441e-177 < z < 7.318632377525781e-214Initial program 11.6
Simplified13.5
Taylor expanded around 0 8.6
Simplified13.1
if 7.318632377525781e-214 < z Initial program 12.6
Simplified1.9
Taylor expanded around 0 4.5
Simplified4.0
rmApplied fma-udef4.0
Simplified4.5
rmApplied associate-/l*1.6
Final simplification3.1
herbie shell --seed 2019326 +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))