\frac{x \cdot \left(y + z\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.244096151631290896943813259882212972022 \cdot 10^{-205}:\\
\;\;\;\;x \cdot \frac{z + y}{z}\\
\mathbf{elif}\;z \le 1.123685082691174413471401852132580668372 \cdot 10^{-120}:\\
\;\;\;\;\frac{1}{z} \cdot \left(\left(z + y\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z + y}{z}\\
\end{array}double f(double x, double y, double z) {
double r24205176 = x;
double r24205177 = y;
double r24205178 = z;
double r24205179 = r24205177 + r24205178;
double r24205180 = r24205176 * r24205179;
double r24205181 = r24205180 / r24205178;
return r24205181;
}
double f(double x, double y, double z) {
double r24205182 = z;
double r24205183 = -1.244096151631291e-205;
bool r24205184 = r24205182 <= r24205183;
double r24205185 = x;
double r24205186 = y;
double r24205187 = r24205182 + r24205186;
double r24205188 = r24205187 / r24205182;
double r24205189 = r24205185 * r24205188;
double r24205190 = 1.1236850826911744e-120;
bool r24205191 = r24205182 <= r24205190;
double r24205192 = 1.0;
double r24205193 = r24205192 / r24205182;
double r24205194 = r24205187 * r24205185;
double r24205195 = r24205193 * r24205194;
double r24205196 = r24205191 ? r24205195 : r24205189;
double r24205197 = r24205184 ? r24205189 : r24205196;
return r24205197;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 12.6 |
|---|---|
| Target | 3.1 |
| Herbie | 3.0 |
if z < -1.244096151631291e-205 or 1.1236850826911744e-120 < z Initial program 13.1
rmApplied *-un-lft-identity13.1
Applied times-frac1.5
Simplified1.5
if -1.244096151631291e-205 < z < 1.1236850826911744e-120Initial program 10.2
rmApplied associate-/l*11.6
rmApplied div-inv11.7
Applied *-un-lft-identity11.7
Applied times-frac10.4
Simplified10.4
Final simplification3.0
herbie shell --seed 2019170 +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))